Skip to content
This repository was archived by the owner on Sep 24, 2024. It is now read-only.

Commit 4117c2e

Browse files
author
Doug Weber
committed
Add TYPE_TEXT and TYPE_BLOB types to the column type parsing
1 parent 74b682c commit 4117c2e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

schema/schema.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const (
2424
TYPE_TIME // time
2525
TYPE_BIT // bit
2626
TYPE_JSON // json
27+
TYPE_TEXT // text (base64 encoded)
28+
TYPE_BLOB // blob (base64 encoded)
2729
)
2830

2931
type TableColumn struct {
@@ -93,6 +95,10 @@ func (ta *Table) AddColumn(name string, columnType string, extra string) {
9395
ta.Columns[index].Type = TYPE_BIT
9496
} else if strings.HasPrefix(columnType, "json") {
9597
ta.Columns[index].Type = TYPE_JSON
98+
} else if strings.HasPrefix(columnType, "text") {
99+
ta.Columns[index].Type = TYPE_TEXT
100+
} else if strings.HasPrefix(columnType, "blob") {
101+
ta.Columns[index].Type = TYPE_BLOB
96102
} else {
97103
ta.Columns[index].Type = TYPE_STRING
98104
}

0 commit comments

Comments
 (0)