Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions google/cloud/sqlalchemy_spanner/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ def get_isolation_levels(self, _):
dict: isolation levels description.
"""
return {"default": "SERIALIZABLE", "supported": ["SERIALIZABLE", "AUTOCOMMIT"]}

@property
def precision_numerics_enotation_large(self):
"""target backend supports Decimal() objects using E notation
to represent very large values."""
return exclusions.open()
7 changes: 4 additions & 3 deletions google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ def visit_large_binary(self, type_, **kw):
def visit_DECIMAL(self, type_, **kw):
return "NUMERIC"

def visit_NUMERIC(self, type_, **kw):
return "NUMERIC"

def visit_VARCHAR(self, type_, **kw):
return "STRING({})".format(type_.length or "MAX")

Expand All @@ -303,6 +300,9 @@ def visit_BOOLEAN(self, type_, **kw):
def visit_DATETIME(self, type_, **kw):
return "TIMESTAMP"

def visit_NUMERIC(self, type_, **kw):
return "NUMERIC"

def visit_BIGINT(self, type_, **kw):
return "INT64"

Expand All @@ -329,6 +329,7 @@ class SpannerDialect(DefaultDialect):
supports_sequences = True
supports_native_enum = True
supports_native_boolean = True
supports_native_decimal = True

ddl_compiler = SpannerDDLCompiler
preparer = SpannerIdentifierPreparer
Expand Down
Loading