Skip to content
This repository was archived by the owner on May 13, 2019. It is now read-only.

Commit 5e5a436

Browse files
committed
Catch any AttributeErrors on primary key detection and return False
1 parent 8c79748 commit 5e5a436

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

asyncqlio/orm/schema/column.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,12 @@ def autoincrement(self) -> bool:
207207
"""
208208
Whether this column is set to autoincrement.
209209
"""
210-
if isinstance(self.table.metadata.bind.dialect, sqlite3.Sqlite3Dialect):
211-
return self.primary_key and isinstance(self.type, md_types.Integer)
212-
return isinstance(self.type, md_types.Serial)
210+
try:
211+
if isinstance(self.table.metadata.bind.dialect, sqlite3.Sqlite3Dialect):
212+
return self.primary_key and isinstance(self.type, md_types.Integer)
213+
return isinstance(self.type, md_types.Serial)
214+
except AttributeError:
215+
return False
213216

214217
# DDL stuff
215218
@classmethod

0 commit comments

Comments
 (0)