Skip to content

Commit 00f02fc

Browse files
committed
Check for column type subclassing
1 parent 92f69cc commit 00f02fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sqlsynthgen/make.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,12 @@ def _get_mimesis_function_for_colum(column: Any) -> Tuple[List[str], str, List[s
214214
column_type = type(column.type)
215215
column_size: Optional[int] = getattr(column.type, "length", None)
216216

217+
# ToDo Add tests and then add issubclass for all of these
218+
# sqlalchemy.dialects.mysql.types.INTEGER
217219
if column_type == sqltypes.BigInteger:
218220
generator_function = "generic.numeric.integer_number"
221+
if column_type == sqltypes.Integer or issubclass(column_type, sqltypes.Integer):
222+
generator_function = "generic.numeric.integer_number"
219223
elif column_type == sqltypes.Boolean:
220224
generator_function = "generic.development.boolean"
221225
elif column_type == sqltypes.Date:

0 commit comments

Comments
 (0)