OK, just read over ATTACH, you issue the "ATTACH DATABASE" command  
textually.  from that point on, the tables in that database are  
accessible using a schemaname syntax (i.e. schemaname.tablename).    
if you really want to just copy tables wholesale, yeah youd have to  
issue "INSERT ... SELECT" statements which also would have to be  
texual at this point.  other operations can be done if you define  
Table objects with "schema=<whatever>", and you can also use  
autoload=True to read them in for you.


On Mar 9, 2007, at 2:12 PM, Karlo Lozovina wrote:

>
> On Mar 9, 4:33 pm, "Michael Bayer" <[EMAIL PROTECTED]> wrote:
>
>> attach database ...wow i never knew it had that !  if its a matter of
>> issuing the string "attach database", just use literal text() or
>> engine.execute().
>
> Me neither ;), until the other day I started looking for an efficient
> way to dump in-memory SQLite databases to hdd. And this ATTACH thing
> sounded just like made for it.
>
>> attach database....very handy !
>
> So, let's say I issue this engine.execute(), how would one proceede
> inserting rows into this attached database. Let's say mem_db is the
> main, in-memory database, and file_db has just been attached, and is a
> in-file database. SQL syntax is somewhat like this: "INSERT INTO
> file_db.table1 SELECT * FROM mem_db.table1", is any way SQLAlchemy can
> do this without resorting to engine.execute() ?
>
> Thanks!
>
> Karlo.
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to