Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread jo
In cx_oracle mailing list, they suggested me, this: ... write your own equivalent of makedsn, which really ought not be too hard. You'd want to emit something like this:

Re: [sqlalchemy] performance vs. psycopg2

2011-12-16 Thread Gaëtan de Menten
On Thu, Dec 15, 2011 at 19:52, Jon Nelson jnel...@jamponi.net wrote: On Thu, Dec 15, 2011 at 12:01 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 15, 2011, at 12:51 PM, Jon Nelson wrote: Up front, I'm not using the ORM at all, and I'm using SQLAlchemy 0.7.4 with psycopg2 2.4.3 on

Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread jo
I solved the problem using this monkeypatch to makedsn as suggested me by Christoph Zwerschke. makedsn = cx_Oracle.makedsn cx_Oracle.makedsn = lambda *args, **kw: makedsn(*args, **kw).replace('SID','SERVICE_NAME') Thaks any way to everyone. j Michael Bayer wrote: yeah I dunno, the

Re: [sqlalchemy] performance vs. psycopg2

2011-12-16 Thread Jon Nelson
On Fri, Dec 16, 2011 at 3:30 AM, Gaëtan de Menten gdemen...@gmail.com wrote: On Thu, Dec 15, 2011 at 19:52, Jon Nelson jnel...@jamponi.net wrote: On Thu, Dec 15, 2011 at 12:01 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 15, 2011, at 12:51 PM, Jon Nelson wrote: Up front, I'm not

Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread Michael Bayer
is that a known bug in cx_Oracle ? On Dec 16, 2011, at 4:45 AM, jo wrote: I solved the problem using this monkeypatch to makedsn as suggested me by Christoph Zwerschke. makedsn = cx_Oracle.makedsn cx_Oracle.makedsn = lambda *args, **kw: makedsn(*args,

Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread jo
I don't know Michael, only that Craig Hagan in oracl...@freelists.org, suggested me this workaround... ...However, I'm pretty sure that the problem is that you're depending upon service names for your connection to succeed (that should be how the url in your working example behaves), but the

[sqlalchemy] Infer (and create) Schema from Example Object/Dictionary

2011-12-16 Thread Gregg Lind
My search skills are failing me, and I hope you all can help. (Apologies that there is some heresy here) Assumptions: 1) Suppose I have objects made from json (dicts of strings, lists of dicts, etc.) 2) (for simplicity, assume these nestings don't go very deep) 3) getting this right 90% of

[sqlalchemy] SQLA without the ORM?

2011-12-16 Thread Vlad K.
Hi all! I have a few scenarios here that I believe are best solved without the ORM overhead. For example, various log tables that do not require a primary key, the rows are practically immutable, but are queried back for statistical analysis. It is my understanding that I cannot use the ORM

Re: [sqlalchemy] SQLA without the ORM?

2011-12-16 Thread Jon Nelson
On Fri, Dec 16, 2011 at 2:55 PM, Vlad K. v...@haronmedia.com wrote: Hi all! I have a few scenarios here that I believe are best solved without the ORM overhead. For example, various log tables that do not require a primary key, the rows are practically immutable, but are queried back for

Re: [sqlalchemy] how add comment before query statement?

2011-12-16 Thread bogun . dmitriy
2011/12/12 Michael Bayer mike...@zzzcomputing.com we have select.prefix_with() which can stick it right after the SELECT, if that worksotherwise if it really has to be the first thing would need to work in some @compiles tricks. then as far as Query I thought we had added something

Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread Michael Bayer
On Dec 16, 2011, at 10:31 AM, jo wrote: I don't know Michael, only that Craig Hagan in oracl...@freelists.org, suggested me this workaround... ...However, I'm pretty sure that the problem is that you're depending upon service names for your connection to succeed (that should be how the

Re: [sqlalchemy] Infer (and create) Schema from Example Object/Dictionary

2011-12-16 Thread Michael Bayer
On Dec 16, 2011, at 1:42 PM, Gregg Lind wrote: My search skills are failing me, and I hope you all can help. (Apologies that there is some heresy here) Assumptions: 1) Suppose I have objects made from json (dicts of strings, lists of dicts, etc.) 2) (for simplicity, assume these

Re: [sqlalchemy] SQLA without the ORM?

2011-12-16 Thread Michael Bayer
On Dec 16, 2011, at 3:55 PM, Vlad K. wrote: Hi all! I have a few scenarios here that I believe are best solved without the ORM overhead. For example, various log tables that do not require a primary key, the rows are practically immutable, but are queried back for statistical

Re: [sqlalchemy] how add comment before query statement?

2011-12-16 Thread Michael Bayer
On Dec 16, 2011, at 4:32 PM, bogun.dmit...@gmail.com wrote: 2011/12/12 Michael Bayer mike...@zzzcomputing.com we have select.prefix_with() which can stick it right after the SELECT, if that worksotherwise if it really has to be the first thing would need to work in some @compiles

Re: [sqlalchemy] SQLA without the ORM?

2011-12-16 Thread Vlad K.
So basically, if I'm understanding the docs correctly, and what you just wrote: Using the session object does not mean using the ORM. The ORM comes in play with Mapper and Mapped instances, which in turn require a primary key defined. So, I can use session.execute() to do non-ORM querying?

Re: [sqlalchemy] SQLA without the ORM?

2011-12-16 Thread Michael Bayer
On Dec 16, 2011, at 7:32 PM, Vlad K. wrote: So basically, if I'm understanding the docs correctly, and what you just wrote: Using the session object does not mean using the ORM. more or lessthough if I wrote a program that had no ORM usage whatsoever I'm not sure I'd have Session

Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread jo
Michael Bayer wrote: On Dec 16, 2011, at 10:31 AM, jo wrote: I don't know Michael, only that Craig Hagan in oracl...@freelists.org, suggested me this workaround... ...However, I'm pretty sure that the problem is that you're depending upon service names for your connection to succeed

Re: [sqlalchemy] sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor

2011-12-16 Thread jo
Michael Bayer wrote: is that a known bug in cx_Oracle ? The latest version of cx_Oracle 5.1 is changed: 5) Added additional parameter service_name to makedsn() which can be used to use the service_name rather than the SID in the DSN string that is generated. makedsn(host =