[sqlalchemy] Association Proxy with Events (working very nice but there is a problem)

2014-01-28 Thread Erkan Özgür Yılmaz
Hi everybody, I'm trying to use Association Proxy in one of my classes relation to itself. I've got a Task class and Tasks can be dependent to each other, and I've also wanted to store the dependency type ('start-to-start', 'start-to-end' etc.), so AssociationProxy was the way I've gone. Any way

Re: [sqlalchemy] Association Proxy with Events (working very nice but there is a problem)

2014-01-28 Thread Michael Bayer
On Jan 28, 2014, at 11:27 AM, Erkan Özgür Yılmaz eoyil...@gmail.com wrote: Hi everybody, I'm trying to use Association Proxy in one of my classes relation to itself. I've got a Task class and Tasks can be dependent to each other, and I've also wanted to store the dependency type

[sqlalchemy] array types using OracleDialect

2014-01-28 Thread a_t_smith
During evaluation of Python 2.7 + SqlAlchemy 0.8.x using OracleDialect, I found most of the features I need exist out of the box; however I don't see a way to pass arrays as inputs to function calls. Am I overlooking an existing capability? ... my searches have come up empty for Oracle but

Re: [sqlalchemy] Association Proxy with Events (working very nice but there is a problem)

2014-01-28 Thread Michael Bayer
yeah, sorry about this issue, it is coming up more and more often. i might have to think of something (which is known to happen fairly often) On Jan 28, 2014, at 12:27 PM, Erkan Özgür Yılmaz eoyil...@gmail.com wrote: Hi Michael, According to your comment, I've updated the

Re: [sqlalchemy] array types using OracleDialect

2014-01-28 Thread Michael Bayer
On Jan 28, 2014, at 3:37 PM, a_t_smith amos.t.sm...@gmail.com wrote: During evaluation of Python 2.7 + SqlAlchemy 0.8.x using OracleDialect, I found most of the features I need exist out of the box; however I don't see a way to pass arrays as inputs to function calls. Am I overlooking

Re: [sqlalchemy] array types using OracleDialect

2014-01-28 Thread Michael Bayer
On Jan 28, 2014, at 3:37 PM, a_t_smith amos.t.sm...@gmail.com wrote: I don't see a way to plumb these cx_Oracle features into sqlalchemy user defined types since they depend on cx_Oracle connection and cursor types. as far as oracle curs.callproc(), SQLAlchemy has no support for that. if

[sqlalchemy] Re: array types using OracleDialect

2014-01-28 Thread a_t_smith
Thanks for the feature request post and information. At the moment I'm just hoping to have a udt s.t. client code can do something like: a = [1,2,3,4,5] oat = OracleArrayType(cx_Oracle.INTEGER, a) func.some_func_expecting_intarray(oat) rp = session.execute(func) However, I don't have enough

Re: [sqlalchemy] Re: array types using OracleDialect

2014-01-28 Thread Michael Bayer
On Jan 28, 2014, at 6:06 PM, a_t_smith amos.t.sm...@gmail.com wrote: Thanks for the feature request post and information. At the moment I'm just hoping to have a udt s.t. client code can do something like: a = [1,2,3,4,5] oat = OracleArrayType(cx_Oracle.INTEGER, a)

Re: [sqlalchemy] Re: array types using OracleDialect

2014-01-28 Thread a_t_smith
Following up on earlier comments I tried manually calling the db function and passing the arrayvar built via cx_Oracle cursor and got ORA-01484: arrays can only be bound to PL/SQL statements. Alternately, I found that manually wrapping the array values with the database type name works, i.e.

[sqlalchemy] SQLite dialect missing data type affinities, causes problems with reflection (DOUBLE, LONGTEXT, etc.)

2014-01-28 Thread Erich Blume
I am somewhat new to SQLAlchemy, but as far as I can tell there is no existing facility in the SA SQLite dialect (sqlalchemy.dialects.sqlite.pysqlite.SQLiteDialect_pysqlite) to resolve SQLite's data type affinities, as shown in section 2.2 of the SQLite data type docs:

[sqlalchemy] Re: SQLite dialect missing data type affinities, causes problems with reflection (DOUBLE, LONGTEXT, etc.)

2014-01-28 Thread Erich Blume
Some additional information - a GUI tool for inspecting sqlite databases tells me that the following is the CREATE syntax for such a table as I mention above: CREATE TABLE invTypes ( typeID integer NOT NULL, groupID integer DEFAULT NULL, typeName varchar(200) DEFAULT NULL,

Re: [sqlalchemy] array types using OracleDialect

2014-01-28 Thread Michael Bayer
On Jan 28, 2014, at 8:30 PM, a_t_smith amos.t.sm...@gmail.com wrote: Following up on earlier comments I tried manually calling the db function and passing the arrayvar built via cx_Oracle cursor and got ORA-01484: arrays can only be bound to PL/SQL statements. Alternately, I found that

Re: [sqlalchemy] SQLite dialect missing data type affinities, causes problems with reflection (DOUBLE, LONGTEXT, etc.)

2014-01-28 Thread Michael Bayer
these types as far as sqlite are concerned are kind of semi-“fake”, they’re just lots of names that all end up having the same effect of an “affinity”, and even that is not very strong as you can still put a text string into these columns. Sqlite gives us no way to just get at the simple

Re: [sqlalchemy] SQLite dialect missing data type affinities, causes problems with reflection (DOUBLE, LONGTEXT, etc.)

2014-01-28 Thread Erich Blume
Section 2.1 ( http://www.sqlite.org/datatype3.html ) has a deterministic algorithm for transforming an unknown column type in to it's inverse-affinity real type. It seems to me that we could modify the code in base.py around 820 (I'm at home and working from memory) to implement that algorithm

Re: [sqlalchemy] SQLite dialect missing data type affinities, causes problems with reflection (DOUBLE, LONGTEXT, etc.)

2014-01-28 Thread Michael Bayer
On Jan 28, 2014, at 10:57 PM, Erich Blume blume.er...@gmail.com wrote: Section 2.1 ( http://www.sqlite.org/datatype3.html ) has a deterministic algorithm for transforming an unknown column type in to it's inverse-affinity real type. It seems to me that we could modify the code in base.py