Hi!
I have an XML file that provides the information needed for table
creation (column names, types, etc.). Is there any easy way in
SQLAlchemy to dynamically build Table objects from this information?
So if I get something like
[{'name': 'firstname', 'type': 'string', 'length': 40}, {'name':
'lastname', 'type': 'string', 'length': 40}]
from the XML file, I want something like
mytable = Table('mytable', metadata,
Column('firstname', types.String(40)),
Column('lastname', types.String(40))
)
to be generated.
(oversimplified, I omitted stuff like primary_key, etc.)
A simple way would be to generate a code string from the information
and execute it with exec, but I'd like to know if there's a better way
to do this in SQLAlchemy.
Thanks,
Frederik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---