Skip to content

Commit ea84f00

Browse files
authored
UUID converts as BLOB instead of UUID
Made in order to ensure compatibility to older versions of SQLite
1 parent c9c7d40 commit ea84f00

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

dbml_sqlite/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,11 @@ def coerceColType(colType):
261261
texts = ('STR', 'DATE', 'DATETIME', 'TIMESTAMP', 'TIME', 'VARCHAR', 'TINYTEXT', 'SMALLTEXT', 'MEDIUMTEXT', 'LONGTEXT')
262262
if colType in texts:
263263
return 'TEXT'
264-
blobs = ('TINYBLOB', 'SMALLBLOB', 'MEDIUMBLOB', 'LONGBLOB', 'BYTE', 'BYTES')
264+
blobs = ('TINYBLOB', 'SMALLBLOB', 'MEDIUMBLOB', 'LONGBLOB', 'BYTE', 'BYTES', 'UUID')
265265
if colType in blobs:
266266
return 'BLOB'
267267
res = re.search(r'VARCHAR\([0-9]+\)', colType)
268268
if res:
269269
return 'TEXT'
270-
same_types = ('UUID')
271-
if colType in same_types:
272-
return colType
273270
else:
274271
raise ValueError(f'Could not figure out how to coerce "{colType}" to valid SQLite type.')

0 commit comments

Comments
 (0)