Re: [sqlalchemy] one-to-one: lost on track

2015-10-01 Thread Richard Gerd Kuesters
ok, just for the record, my "lazyness" lead me to use `lazy='joined'` in a backref and now things works fine :) richard. On 10/01/2015 09:03 AM, Richard Gerd Kuesters wrote: hey all! i think i got lost on track about relationships, specially one-to-one. i'll not go into (code) details

Re: [sqlalchemy] Please advice with new oracle 'OFFSET x ROWS FETCH NEXT x ROWS' approach in 12c

2015-10-01 Thread Ralph Heinkel
On Tuesday, September 29, 2015 at 5:54:03 PM UTC+2, Michael Bayer wrote: > > > On 9/29/15 9:50 AM, Ralph Heinkel wrote: > > In short this looks like: > > SELECT val > FROM some_table > ORDER BY val > OFFSET 4 ROWS FETCH NEXT 4 ROWS ONLY; > > it's like OK we can add a LIMIT/OFFSET feature, but

[sqlalchemy] one-to-one: lost on track

2015-10-01 Thread Richard Gerd Kuesters
hey all! i think i got lost on track about relationships, specially one-to-one. i'll not go into (code) details because all my one-to-one are failing with the following exception: * * *python2.7/site-packages/sqlalchemy/orm/query.pyc in _no_criterion_assertion(self, meth, order_by,

Re: [sqlalchemy] funky session usage to add join conditions and where clauses

2015-10-01 Thread Chris Withers
On 26/09/2015 21:15, Mike Bayer wrote: On 9/25/15 12:24 PM, Chris Withers wrote: On 25/09/2015 13:58, Mike Bayer wrote: session.query(A).filter(A.id>10).as_at(now)) you'd need to subclass Query and dig into Query.column_descriptions to get at the existing entities, then add all that

Re: [sqlalchemy] Postgres' arrays in subqueries

2015-10-01 Thread Mike Bayer
On 10/1/15 4:35 AM, artee wrote: Mike and others :) I have the following sql: select models.code, *array*( select *(clients.id, clients.code) *from clients group by clients.id, clients.code ) as envs from models I ended with something like this: items =

Re: [sqlalchemy] unregister Tables from Metadata

2015-10-01 Thread Mike Bayer
On 10/1/15 5:56 AM, Pavel S wrote: Hi, we use application-level partitioning (but no real partitioning in mysqld), where new tables are created daily with the same structure, but different name (suffix). * mysqld is shared for these components: * daemon written in C++ o creates

Re: [sqlalchemy] Is there a better and more idiomatic way to accomplish this?

2015-10-01 Thread Mike Bayer
On 10/1/15 11:41 AM, Massimiliano della Rovere wrote: Greetings, I have two questions to the following code that works, but looks dirty to me. Being new to SQLAlchemy I'd like to ask for advices. The database is PostgreSQL. The following check_xyz function must check whether the index

[sqlalchemy] Is there a better and more idiomatic way to accomplish this?

2015-10-01 Thread Massimiliano della Rovere
Greetings, I have two questions to the following code that works, but looks dirty to me. Being new to SQLAlchemy I'd like to ask for advices. The database is PostgreSQL. The following check_xyz function must check whether the index "table_xyz_idx" exists in table "table". The table surely

[sqlalchemy] unregister Tables from Metadata

2015-10-01 Thread Pavel S
Hi, we use application-level partitioning (but no real partitioning in mysqld), where new tables are created daily with the same structure, but different name (suffix). - mysqld is shared for these components: - daemon written in C++ - creates new tables every day and fills

Re: [sqlalchemy] SQLTap 0.3.10 released

2015-10-01 Thread George Reilly
On Mon, Sep 28, 2015 at 1:04 AM, David Allouche wrote: > On 28 Sep 2015, at 05:21, George V. Reilly > wrote: > > SQLTap is a very useful library that helps you in profiling SQLAlchemy > queries. It helps you understand where and when SQLAlchemy

[sqlalchemy] Postgres' arrays in subqueries

2015-10-01 Thread artee
Mike and others :) I have the following sql: select models.code, *array*( select *(clients.id, clients.code) *from clients group by clients.id, clients.code ) as envs from models I ended with something like this: items = DBSession.query(Client.id, Client.code). \