Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-09 Thread eli rashlin
Thank you Michael. On Sunday, June 7, 2015 at 11:06:32 PM UTC+3, Michael Bayer wrote: which part of it. you can just try running it to start. when you want to use a certain schema, you'd say: session = Session() with session_schema(session, 'myschema'): # do things with session

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-07 Thread Mike Bayer
which part of it. you can just try running it to start. when you want to use a certain schema, you'd say: session = Session() with session_schema(session, 'myschema'): # do things with session that's pretty much it. session_schema is basically what session_shardid is in the recipe.

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-07 Thread eli rashlin
Hi Michael, can you help me with the recipe I'm confuce on how to use it (I'm sorry but I'm probably still a newbie) -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread Mike Bayer
you don't need the patch. Take a look at the recipe here: https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/SessionModifiedSQL I added a note on how to make it work for schema name on a per-session basis. On 6/4/15 2:04 PM, eli rashlin wrote: Thank you Michal. I will try to

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread eli rashlin
Thank you so much Mike - I'll try it right away :) -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group,

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread Mike Bayer
On 6/4/15 12:10 PM, eli rashlin wrote: Thank you. I tried the method described here https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/EntityName https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/EntityName, my tables are defined as modules but I'm unable to understand how

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread eli rashlin
Thank you Michal. I will try to install the patch, It might be a bit problematic as my sqlalchemy version is quite old (0.6.8) and the patch seems to be built for version 0.9 and up. Worst case scenario I can write down the queries by myself and concat the schema name -- You received this

[sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread eli rashlin
Thank you. I tried the method described here https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/EntityName, my tables are defined as modules but I'm unable to understand how he does it those are my classes GlobBase.py: from sqlalchemy.ext.declarative import declarative_base from

[sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread eli rashlin
Thank you. I tried the method described here https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/EntityName, my tables are defined as modules but I'm unable to understand how he does it those are my classes GlobBase.py: from sqlalchemy.ext.declarative import declarative_base from

[sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread eli rashlin
yes but the schema is different for each run, I dont want it to be hard coded into the table definition. On Tuesday, June 2, 2015 at 12:52:22 PM UTC+3, eli rashlin wrote: Hi, I have a very strange behavior, I have a program that uses bulk insertions to the DB. for some reason the

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-04 Thread Mike Bayer
On 6/4/15 3:28 AM, eli rashlin wrote: yes but the schema is different for each run, I dont want it to be hard coded into the table definition. that we don't support. Issue https://bitbucket.org/zzzeek/sqlalchemy/issue/2685/default-schema-schema-translation-map-as proposes this. To get

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-03 Thread eli rashlin
Thank you Michael for your answer. How can I use the schema in a query object, is there a way to do it? On Tuesday, June 2, 2015 at 6:26:43 PM UTC+3, Michael Bayer wrote: On 6/2/15 5:54 AM, eli rashlin wrote: BTW is there a way in sqlalchemy to append the name of the database to the

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-03 Thread Mike Bayer
On 6/3/15 7:43 AM, eli rashlin wrote: Thank you Michael for your answer. How can I use the schema in a query object, is there a way to do it? if the Table has schema on it, the schema name will be rendered into queries automatically.. On Tuesday, June 2, 2015 at 6:26:43 PM UTC+3,

[sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-02 Thread eli rashlin
BTW is there a way in sqlalchemy to append the name of the database to the table name like SELECT * from dbname.table_name -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [sqlalchemy] Re: getting 'No database selected' randomly from session

2015-06-02 Thread Mike Bayer
On 6/2/15 5:54 AM, eli rashlin wrote: BTW is there a way in sqlalchemy to append the name of the database to the table name like SELECT * from dbname.table_name this is the schema argument documented at