From 3d7e02e0a990666a69c968a7e9224e13707fdfe5 Mon Sep 17 00:00:00 2001 From: thealphadollar Date: Fri, 18 Aug 2023 16:30:00 +0530 Subject: [PATCH] add: support for JSON type --- server/table.go | 4 ++++ server/value.go | 1 + 2 files changed, 5 insertions(+) diff --git a/server/table.go b/server/table.go index b9be13e..2a71009 100644 --- a/server/table.go +++ b/server/table.go @@ -268,6 +268,8 @@ func newColumn(def *ast.ColumnDef) *Column { dbdt = DBDTText case TCArray: dbdt = DBDTJson + case TCJson: + dbdt = DBDTJson } var allowCommitTimestamp bool @@ -307,6 +309,8 @@ func astTypeToTypeCode(astTypeName ast.ScalarTypeName) TypeCode { return TCDate case ast.TimestampTypeName: return TCTimestamp + case ast.ScalarTypeName("JSON"): + return TCJson default: panic("unknown type") } diff --git a/server/value.go b/server/value.go index 4586efc..196e215 100644 --- a/server/value.go +++ b/server/value.go @@ -228,6 +228,7 @@ const ( TCBytes TCArray TCStruct + TCJson ) type ArrayValue interface {