Skip to content

Commit 0395eb3

Browse files
authored
Merge pull request #45 from sede-open/release/release-2024-01-15-pk
Release/release 2024 01 15 pk
2 parents 543b34c + e1cdcc0 commit 0395eb3

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/databricks/sqlalchemy/dialect/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def visit_create_table(self, create, **kw):
101101
processed = self.process(
102102
create_column, first_pk=column.primary_key and not first_pk
103103
)
104+
if column.autoincrement is True: # If doesn't work try 'is True' and == 'True'
105+
processed = "`".join(processed.split("`")[:-1]) + "` " + "BIGINT GENERATED ALWAYS AS IDENTITY"
104106
if processed is not None:
105107
text += separator
106108
separator = ", \n"

src/databricks/sqlalchemy/dialect/compiler.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ class DatabricksTypeCompiler(compiler.GenericTypeCompiler):
77
def visit_INTEGER(self, type_):
88
return "INT"
99

10+
def visit_BIGINT(self, type_):
11+
return "BIGINT"
12+
1013
def visit_NUMERIC(self, type_):
1114
if type_.precision is None:
1215
return "DECIMAL"

0 commit comments

Comments
 (0)