On Aug 27, 2010, at 1:05 AM, Paul McNett wrote:

> I make sql script files, like:
> 
> {{{
> create table customers (id char(40), name char(64), ...)
> create table blah (id char(40)...)
> ...
> }}}

        Same here.

> and then I execute them in Python like:
> 
> {{{
> import sqlite3.dbapi2 as sqlite
> 
> con = sqlite.connect("path_to_new_db")
> cur = con.cursor()
> cur.executescript(open("myscript.sql").read())
> con.commit()
> }}}


        Sounds like a lot of work. I just do this at the command line:

sqlite3 path_to_new_db < myscript.sql



-- Ed Leafe



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to