How can I load a sql "dump" file into sql alchemy

Posted by JudoWill on Stack Overflow See other posts from Stack Overflow or by JudoWill
Published on 2010-05-13T03:23:29Z Indexed on 2010/05/13 4:04 UTC
Read the original article Hit count: 261

Filed under:
|
|

I have a large sql dump file ... with multiple CREATE TABLE and INSERT INTO statements. Is there any way to load these all into a SQLAlchemy sqlite database at once. I plan to use the introspected ORM from sqlsoup after I've created the tables. However, when I use the engine.execute() method it complains: sqlite3.Warning: You can only execute one statement at a time.

Is there a way to work around this issue. Perhaps splitting the file with a regexp or some kind of parser, but I don't know enough SQL to get all of the cases for the regexp.

Any help would be greatly appreciated.

Will

EDIT: Since this seems important ... The dump file was created with a MySQL database and so it has quite a few commands/syntax that sqlite3 does not understand correctly.

© Stack Overflow or respective owner

Related posts about sql

Related posts about python