David McNab wrote:
> Hi,
> 
> I've got several SQlite databases, each with the same tables and
> schemas.
> 
> What's the best way to move data between them?
> 
> I understand that with SQLObject, one can make a connection to a single
> database global, as in:
> 
>    conn = SQLiteConnection("/path/to/dbfile.sqlite")
>    sqlhub.processConnection = conn
> 
> or one can assign the connection on a per-class basis, as in:
> 
>    class SomeTable(SQLObject):
>        col1 = StringCol()
>        ...
> 
>    ...
> 
>    SomeTable._conn = conn
> 
> But what if I have n sqlite database files, each with the same tables
> and schemas, and want to dynamically access them and move data between
> them?
> 
> IIRC, SQLObject keeps a 'registry' of declared tables, so it wouldn't be
> legal to have n different table classes of the same name, each using a
> different database connection.
> 
> What should I do?
> 
> Thanks for any help..
> 
> Cheers
> David

Hi David,

If the tables have the same schemas then you can use the same object and 
just use different connection objects when you use each instance of the 
object.

You'll obviously have to save a connection object for each sqlite 
database you have.

I found reply I made to a similar question here:
http://sourceforge.net/mailarchive/message.php?msg_id=44F63826.2030700%40nscus.com

Regards,

Ray Smith
http://RaymondSmith.com

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to