[sqlalchemy] Re: Error during metadata reflect()

2009-06-30 Thread Michael Bayer
that might be a bug in reflection within the sqlite dialect. make sure the bug still replicates on 0.5.4 and perhaps you can send us SQLite's pragma "table" for that table (via mailing list here or post a trac ticket as guest/guest). On Jun 30, 2009, at 10:15 PM, Carl wrote: > > Hi, > C

[sqlalchemy] Error during metadata reflect()

2009-06-30 Thread Carl
Hi, Can anyone tell me what's I'm doing worng. The DB itself is fine I access it via SA successfully from my web app (TG2). But, I need to write a utility that uses it outside of the web app. Here is my code: >>> db = 'sqlite:///data/test.db' >>> e = create_engine(db) >>> m = MetaData(bind=e) >>

[sqlalchemy] Re: Quoting Issue with Sybase ASE

2009-06-30 Thread Vishakh
Hello, Thanks for your replies. I am working on Windows XP with Sybase OCS, perhaps that is why pjjH's code doesn't work out of the box for me. For example, I am unable to import _FetchLazy. Would I have to install FreeTDS to get this working? Is it a wise idea to adapt this to Windows? I wrote

[sqlalchemy] Re: SQLAlchemy as a FIFO buffer?

2009-06-30 Thread Michael Bayer
allen.fowler wrote: > > > > Quick questions: > How doe this code handle transactions? engine.execute() is an "autocommit" method. the SQL expression is executed in a new transaction which is immediately committed. > Where in the code does it atomically assign a task to a worker without > making

[sqlalchemy] Re: unit testing idioms

2009-06-30 Thread Mike Orr
On Wed, Jun 24, 2009 at 3:11 PM, Chris Withers wrote: > > Hi All, > > I'm wondering what the common idiom is for unit testing w.r.t. data and > transactions... > > So, coming from my ZODB background, in unit tests we usually: > > - set up the objects required > - run the code to be tested (which m

[sqlalchemy] Re: SQLAlchemy as a FIFO buffer?

2009-06-30 Thread allen.fowler
> I've attached a proof of concept for how I've approached the "homegrown" > version of this in the past.   a jobs table has two update passes - one to > atomically mark jobs as "in progress" by a certain procid, then the > transaction is released so that other processes can theoretically work on

[sqlalchemy] Re: SQLAlchemy as a FIFO buffer?

2009-06-30 Thread allen.fowler
On Jun 30, 11:25 am, Didip Kerabat wrote: > If you are open to non RDBMS solution, sounds like what you need is message > queue system. > > At work, we use RabbitMQ (memory-only) and have been quite happy with it. > > SecondLife posted their discovery about MQ > here:http://wiki.secondlife.com

[sqlalchemy] Re: SqlAlchemy limiting returned rows prematurely

2009-06-30 Thread Mike Driscoll
Hi all, > > > Mike Driscoll wrote: > > > > Hi, > > > > On Jun 30, 8:10 am, Maciej Szumocki wrote: > > >> I think the problem might be not the query itself, but the date ranges > > >> that get converted using wrong date format. Do you get the same > > >> results if you use real datetime objects

[sqlalchemy] Re: SqlAlchemy limiting returned rows prematurely

2009-06-30 Thread Mike Driscoll
Hi, On Jun 30, 10:42 am, "Michael Bayer" wrote: > Mike Driscoll wrote: > > > Hi, > > > On Jun 30, 8:10 am, Maciej Szumocki wrote: > >> I think the problem might be not the query itself, but the date ranges > >> that get converted using wrong date format. Do you get the same > >> results if you

[sqlalchemy] Dumping select data to SQL with relationships

2009-06-30 Thread Arthur Pemberton
Good day, I'd like to know if there is a quick way to do the following: 1) reflect an existing database (I know SA does this well) 2) SELECT a few entries of a main table Foo, preserving all relationships 3) generate INSERT statements to create the selected Foo entries and their relationships

[sqlalchemy] Re: SQLAlchemy as a FIFO buffer?

2009-06-30 Thread Michael Bayer
>> > > I have several CGI and cron scripts and that I would like coordinate >> > > via a "First In / First Out" style buffer.That is, some >> processes >> > > are adding work units, and some take the oldest and start work on >> > > them. >> > >> > > Since I need the queue to both survive system

[sqlalchemy] Re: SqlAlchemy limiting returned rows prematurely

2009-06-30 Thread Michael Bayer
Mike Driscoll wrote: > > Hi, > > On Jun 30, 8:10 am, Maciej Szumocki wrote: >> I think the problem might be not the query itself, but the date ranges >> that get converted using wrong date format. Do you get the same >> results if you use real datetime objects instead of strings there? > > I was

[sqlalchemy] Re: SQLAlchemy as a FIFO buffer?

2009-06-30 Thread Didip Kerabat
If you are open to non RDBMS solution, sounds like what you need is message queue system. At work, we use RabbitMQ (memory-only) and have been quite happy with it. SecondLife posted their discovery about MQ here: http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes - Didip - On Mon, J

[sqlalchemy] Re: Quoting Issue with Sybase ASE

2009-06-30 Thread phrrn...@googlemail.com
> as a note, I made some attempts with the sybase dialect and I can say   > that FreeTDS with sybase is not usable at all since it doesn't render   > bind parameters correctly.   This is correct if one is using the FreeTDS implementation of the CT- Lib API but is not the case when using pyodbc: p

[sqlalchemy] Re: Quoting Issue with Sybase ASE

2009-06-30 Thread phrrn...@googlemail.com
I spent a while on converting the ASA dialect to run on ASE via pyodbc and python Sybase on top of both 12.5.x and 15.x. It was interesting but in hindsight I wish I had started from scratch as I burned a lot of time on some very low-level (and ultimately uninteresting) issues with unicode, FreeTD

[sqlalchemy] Re: SqlAlchemy limiting returned rows prematurely

2009-06-30 Thread Mike Driscoll
Hi, On Jun 30, 8:10 am, Maciej Szumocki wrote: > I think the problem might be not the query itself, but the date ranges > that get converted using wrong date format. Do you get the same > results if you use real datetime objects instead of strings there? I was beginning to think along the same

[sqlalchemy] Re: Quoting Issue with Sybase ASE

2009-06-30 Thread Michael Bayer
On Jun 30, 2009, at 12:09 AM, Vishakh wrote: > > Hello, > > I am modifying Alexander Houben's Sybase module in order to get > SQLAlchemy working with Sybase Adaptive Server Enteprise. I am using > Python 2.6, Pylons and Sybase OCS 12.5, with both mxODBC and pyodbc. > So far, I have had some succ

[sqlalchemy] Quoting Issue with Sybase ASE

2009-06-30 Thread Vishakh
Hello, I am modifying Alexander Houben's Sybase module in order to get SQLAlchemy working with Sybase Adaptive Server Enteprise. I am using Python 2.6, Pylons and Sybase OCS 12.5, with both mxODBC and pyodbc. So far, I have had some success with reflecting tables and issuing basic queries. Howeve

[sqlalchemy] Re: SqlAlchemy limiting returned rows prematurely

2009-06-30 Thread Maciej Szumocki
I think the problem might be not the query itself, but the date ranges that get converted using wrong date format. Do you get the same results if you use real datetime objects instead of strings there? --~--~-~--~~~---~--~~ You received this message because you are

[sqlalchemy] compile().params

2009-06-30 Thread Ash
Hello, I am trying to make the in clause and appending in where clause with and/or I used in_ to make the in clause I want to make the dynamic where so i go on makking the and_, or _and the end result i put in where Now the priblem is with in clause. Eg : i made in like res = id in_((1,2,3,4