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 24, 2024
1 parent 67b2e32 commit bda9012
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 @@ -245,6 +245,12 @@ def visit_FLOAT_VECTOR(self, type_, **kw):
raise ValueError("FloatVector must be initialized with dimension size")
return f"FLOAT_VECTOR({dimensions})"

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

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

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/compiler.py#L249

Added line #L249 was not covered by tests

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

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

View check run for this annotation

Codecov / codecov/patch

src/sqlalchemy_cratedb/compiler.py#L252

Added line #L252 was not covered by tests


class CrateCompiler(compiler.SQLCompiler):

Expand Down

0 comments on commit bda9012

Please sign in to comment.