Skip to content

Commit

Permalink
Types: Improve type mapping for scalars and arrays
Browse files Browse the repository at this point in the history
AFAIK, this is needed for reverse type lookups / reflections.
  • Loading branch information
amotl committed Jan 15, 2024
1 parent 07bba7b commit 9324bf1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/sqlalchemy_cratedb/dialect.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,23 @@
"smallint": sqltypes.SmallInteger,
"timestamp": sqltypes.TIMESTAMP,
"timestamp with time zone": sqltypes.TIMESTAMP,
"timestamp without time zone": sqltypes.TIMESTAMP,
"object": ObjectType,
"object_array": ObjectArray, # TODO: Can this also be improved to use `sqltypes.ARRAY`?
"integer": sqltypes.Integer,
"long": sqltypes.NUMERIC,
"bigint": sqltypes.NUMERIC,
"integer_array": sqltypes.ARRAY(sqltypes.Integer),
"long": sqltypes.BIGINT,
"long_array": sqltypes.ARRAY(sqltypes.BIGINT),
"bigint": sqltypes.BIGINT,
"bigint_array": sqltypes.ARRAY(sqltypes.BIGINT),
"double": sqltypes.DECIMAL,
"double precision": sqltypes.DECIMAL,
"object_array": ObjectArray,
"float": sqltypes.Float,
"real": sqltypes.Float,
"float_array": sqltypes.ARRAY(sqltypes.Float),
"real": sqltypes.DOUBLE,
"real_array": sqltypes.ARRAY(sqltypes.DOUBLE),
"string": sqltypes.String,
"text": sqltypes.String
"text": sqltypes.String,
}
try:
# SQLAlchemy >= 1.1
Expand Down

0 comments on commit 9324bf1

Please sign in to comment.