Skip to content

Commit

Permalink
Types: Emulate PostgreSQL's JSON(B) types using CrateDB's OBJECT
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jun 25, 2024
1 parent 6db4702 commit 70549f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sqlalchemy_cratedb/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ def visit_TIMESTAMP(self, type_, **kw):
(type_.timezone and "WITH" or "WITHOUT") + " TIME ZONE",
)

def visit_JSON(self, type_, **kw):
return "OBJECT"

Check warning on line 259 in src/sqlalchemy_cratedb/compiler.py

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/compiler.py#L259

Added line #L259 was not covered by tests

def visit_JSONB(self, type_, **kw):
return "OBJECT"

Check warning on line 262 in src/sqlalchemy_cratedb/compiler.py

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/compiler.py#L262

Added line #L262 was not covered by tests


class CrateCompiler(compiler.SQLCompiler):

Expand Down

0 comments on commit 70549f0

Please sign in to comment.