Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Petr Jakeš
On Feb 5, 2008 11:05 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Wed, Feb 06, 2008 at 12:57:08AM +0300, Oleg Broytmann wrote: > > class MyTable(SQLObject): > >_connection = connection > > > > class MyTable2(SQLObject): > >_connection = connection2 > > BTW, both _connection and the

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Petr Jakeš
On Feb 5, 2008 11:14 PM, Petr Jakeš <[EMAIL PROTECTED]> wrote: > On Feb 5, 2008 11:05 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > > > On Wed, Feb 06, 2008 at 12:57:08AM +0300, Oleg Broytmann wrote: > > > class MyTable(SQLObject): > > >_connection = connection > > > > > > class MyTable2(SQL

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Oleg Broytmann
On Wed, Feb 06, 2008 at 12:57:08AM +0300, Oleg Broytmann wrote: > class MyTable(SQLObject): >_connection = connection > > class MyTable2(SQLObject): >_connection = connection2 BTW, both _connection and the parameter to .setConnection() can be a DB URI string - SQLObject calls connectio

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Oleg Broytmann
On Tue, Feb 05, 2008 at 10:52:52PM +0100, Petr Jake?? wrote: > My tables are two different tables in two different databases. Then your way is even simpler: class MyTable(SQLObject): _connection = connection class MyTable2(SQLObject): _connection = connection2 Oleg. -- Oleg Broyt

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Petr Jakeš
> > Yes. And you don't need to redecalre tables - if MyTable and MyTable2 > are realy the same table - just do > > MyTable.createTable(ifNotExists=True, connection=connection2) > > > And after that, it is not necessary to take care about the connection in > the > > rest of the code? > > No, after

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Oleg Broytmann
On Tue, Feb 05, 2008 at 10:27:05PM +0100, Petr Jake?? wrote: > So you mean it is OK to crate table object using: > > db_filename = 'c|\\Program > Files\\Firebird\\Firebird_2_0\\examples\\empbuild\\automat.fdb' > connection_string = 'firebird://127.0.0.1:3050/' + db_filename > connection = connecti

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Petr Jakeš
You cannot do this with sqlhub. You have to pass the second connection > as the connection parameter to all SQLObject methods: > > connection2 = connectionForURI('sqlite:///work/mincovnik.db') > ATable.select(clause, connection=connection2) > > Oleg. So you mean it is OK to crate table obje

Re: [SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Oleg Broytmann
On Tue, Feb 05, 2008 at 08:55:35PM +0100, Petr Jake?? wrote: > Hi, > I have not clue how to realize simultaneous conection for two different > databases in one script. > > For example: > > 1) > db_filename = '/opt/firebird/examples/empbuild/automat.fdb' > connection_string = 'firebird://127.0.0.1

[SQLObject] simultaneous conection to 2 different databases

2008-02-05 Thread Petr Jakeš
Hi, I have not clue how to realize simultaneous conection for two different databases in one script. For example: 1) db_filename = '/opt/firebird/examples/empbuild/automat.fdb' connection_string = 'firebird://127.0.0.1:3050/' + db_filename connection = connectionForURI(connection_string) sqlhub.p