It's possible to use a string id in SQLObject tables,
but you have to write your own createTable() method.
These patches modify the createIDColumn() methods in
the various *connection.py modules to test for
sqlmeta.idType == str and create the table accordingly.
I've only tested postgres, mysql, sqlite so far.
I didn't notice the test_stringid.py test until after I
wrote test_string_id.py. If accepted, my test should
probably replace the older one, since test_stringid.py
would be redundant and doesn't require overriding
A further refinement later may be to see if StringCol
defines a length parameter and use it as a CHAR(n) or
VARCHAR(n) type rather than TEXT.
Log in to post a comment.