[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-14 Thread Michael Bayer
Russell Warren wrote: > > Why not? Is it really guessing when the table has been defined > precisely within SQLA? If you have a Column that has been defined to > be an Integer primary key that is supposed to autoincrement, and you > are using sqlite... how could you be wrong? autoincrement is v

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread az
On Saturday 14 June 2008 06:28:58 Russell Warren wrote: > > if you'd like to specify a value generator for the columns, just > > use a ColumnDefault. Whatever function or SQL you like will be > > called if no value is present - its just in this case we can't > > rely upon SQLite's OID generation.

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread az
On Saturday 14 June 2008 06:50:23 Russell Warren wrote: > > so far i have found these ways to hack somebeody else's source: > > a) inherit the class, replace whatever, use the new version - > > works if it is just you using the new-stuff > > b) complete replacement: import thatclass; thatclass.m

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Russell Warren
> so far i have found these ways to hack somebeody else's source: > a) inherit the class, replace whatever, use the new version - works > if it is just you using the new-stuff > b) complete replacement: import thatclass; thatclass.method = > your-own-version > c) partial hacks: inspect.get_sour

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Russell Warren
> if you'd like to specify a value generator for the columns, just use a > ColumnDefault. Whatever function or SQL you like will be called if no > value is present - its just in this case we can't rely upon SQLite's > OID generation. Thanks - I'll look into that. I just have to figure out how t

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Michael Bayer
for example, heres a beast of a unit test: python test/orm/inheritance/query.py --log-debug=sqlalchemy.engine -- db oracle PolymorphicUnionsTest.test_primary_eager_aliasing When you run on SQLite, one of the queries is: SELECT anon_1.people_person_id AS anon_1_people_person_id, anon_1.people

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Michael Bayer
On Jun 13, 2008, at 3:58 AM, Egil Möller wrote: > I and a coworker are currently working on a patch-set to the oracle > driver for SA for this very reason, fixing issues like: > > * broken mangling of forbidden/to long table/column names really ? we have a lot of tests which pass fine for that

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Michael Bayer
On Jun 13, 2008, at 1:00 AM, Russell Warren wrote: > > Any help is appreciated. I expect I'm in over my head trying to mess > with a dialect implementation. I'm also worried that this will just > be the first of many things like this I'll be trying to overcome to > get SQLA to truly abstract t

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread az
On Friday 13 June 2008 16:34:47 Paul Johnston wrote: > Hi, > > I don't think that is a very workable strategy in the long run :( > There > > > are far to many bogus restrictions in some databases, e.g. > > Oracle, for any meaningful program to > > be written to work on all platforms w/o support/wr

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Paul Johnston
Hi, I don't think that is a very workable strategy in the long run :( There > are far to many bogus restrictions in some databases, e.g. Oracle, for > any meaningful program to > be written to work on all platforms w/o support/wrapping/hiding of ugly > details by SA. This is often a difficulty f

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread Egil Möller
> YMMV. it is actualy you who break things. e.g. if u dont rely much on > specific SQldialect notions, or better, on specific SQL notions, > you'r settled. > i've made dbcook over SA and ever since the team have forgotten about > what SQL is, except some very tricky things which has to be

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread az
> 3. What internal SQLA structures can I count on staying fixed > through revisions? everything changes/can change. so just do it, and keep doors opened for being version-aware (or actualy make them later). i have a lot of this stuff, look in the dbcook sources. e.g. after rev260 i've whacked

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-13 Thread az
> And a related question: What is the general feeling on how well > SQLA abtstracts the underlying database away? Am I expecting too > much to be able to write my application using SQLA-only from the > beginning and have it work on any of the popular databases without > much tweaking? YMMV. it i

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-12 Thread az
> 1. How do I override SQLiteCompiler.visit_insert without modifying > SQLA's sqlite.py? I of course want to avoid trashing the base SQLA > install, but can't find an override location in the object tree > from my session or engine or anything. so far i have found these ways to hack somebeody els

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-06-12 Thread Russell Warren
> judging by the slapdown in this ticket, and it looks safe to say that > this behavior in SQLite will never change: > > http://www.sqlite.org/cvstrac/tktview?tn=2553 backend of Yow - that is a pretty terse slapdown! It doesn't seem like sqlite will ever support it. I keep hoping that sqlalchem

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-05-31 Thread Michael Bayer
judging by the slapdown in this ticket, and it looks safe to say that this behavior in SQLite will never change: http://www.sqlite.org/cvstrac/tktview?tn=2553 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sql

[sqlalchemy] Re: sqlite PK autoincrement not working when you do a composite PK?

2008-05-31 Thread Michael Bayer
On May 31, 2008, at 12:38 AM, Russell Warren wrote: > > I've tried sifting through the sqlite dialect to figure out what is > going on and have even tried forcing supports_pk_autoincrement to be > true, but it rapidly became clear I hadn't a clue what I was doing in > the sqlalchemy guts. > > Do