Skip to content

Commit 90c742c

Browse files
committed
Types: Emulate PostgreSQL's JSON(B) types using CrateDB's OBJECT
1 parent 435ec4e commit 90c742c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sqlalchemy_cratedb/compiler.py

+6
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,12 @@ def visit_TIMESTAMP(self, type_, **kw):
254254
"""
255255
return "TIMESTAMP %s" % ((type_.timezone and "WITH" or "WITHOUT") + " TIME ZONE",)
256256

257+
def visit_JSON(self, type_, **kw):
258+
return "OBJECT"
259+
260+
def visit_JSONB(self, type_, **kw):
261+
return "OBJECT"
262+
257263

258264
class CrateCompiler(compiler.SQLCompiler):
259265
def visit_getitem_binary(self, binary, operator, **kw):

0 commit comments

Comments
 (0)