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

AttributeErrors on Serial AutoIncrement detection #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions asyncqlio/orm/schema/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@ def autoincrement(self) -> bool:
"""
Whether this column is set to autoincrement.
"""
if isinstance(self.table.metadata.bind.dialect, sqlite3.Sqlite3Dialect):
return self.primary_key and isinstance(self.type, md_types.Integer)
return isinstance(self.type, md_types.Serial)
try:
if isinstance(self.table.metadata.bind.dialect, sqlite3.Sqlite3Dialect):
return self.primary_key and isinstance(self.type, md_types.Integer)
return isinstance(self.type, md_types.Serial)
except AttributeError:
return False

# DDL stuff
@classmethod
Expand Down