Skip to content

Commit cbfa130

Browse files
authored
Merge pull request #96 from thealphadollar/support_json_datatype
Add: Support For JSON Type
2 parents 9379ddd + 3d7e02e commit cbfa130

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

server/table.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ func newColumn(def *ast.ColumnDef) *Column {
268268
dbdt = DBDTText
269269
case TCArray:
270270
dbdt = DBDTJson
271+
case TCJson:
272+
dbdt = DBDTJson
271273
}
272274

273275
var allowCommitTimestamp bool
@@ -307,6 +309,8 @@ func astTypeToTypeCode(astTypeName ast.ScalarTypeName) TypeCode {
307309
return TCDate
308310
case ast.TimestampTypeName:
309311
return TCTimestamp
312+
case ast.ScalarTypeName("JSON"):
313+
return TCJson
310314
default:
311315
panic("unknown type")
312316
}

server/value.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ const (
228228
TCBytes
229229
TCArray
230230
TCStruct
231+
TCJson
231232
)
232233

233234
type ArrayValue interface {

0 commit comments

Comments
 (0)