from testlib import testing
+import itertools
schema = None
__all__ = 'Table', 'Column',
return schema.Table(*args, **kw)
+generic_counter = itertools.count()
+
def Column(*args, **kw):
"""A schema.Column wrapper/hook for dialect-specific tweaks."""
if schema is None:
from sqlalchemy import schema
- # TODO: a Column that creates a Sequence automatically for PK columns,
- # which would help Oracle tests
+ if testing.against('oracle'):
+ if kw.get('primary_key') == True and kw.get('default') == None:
+ kw['default'] = generic_counter.next
+
return schema.Column(*args, **kw)