[sqlalchemy] Re: Explicit column in a SelectResults qry.

2007-03-08 Thread che
Hi, it would be good if SA has similar feature to return scalar, but from the point of view of objects - SA internally knows inheritance and so on ... so one doesnt have to bother of exact tables, but only the object. This can be usefull for reporting on top of SA - see for example if you have

[sqlalchemy] Re: Explicit column in a SelectResults qry.

2007-03-08 Thread Glauco
Michael Bayer ha scritto: SelectResults is used for mapped classes, the columns that are to be selected for a particular mapping are fixed. theres no reason youd want to be able to change the column clause. I try to do an example: create table macrocategory ( code char(3),

[sqlalchemy] Re: fetchmany() vs sqlite

2007-03-08 Thread Lele Gaifax
Michael Bayer wrote: FB - ?? I confirm that the kinterbasdb follows the DBAPI here, and thus its Cursor.fetchmany() accepts an optional positional argument for the size. ciao, lele. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: fetchmany() vs sqlite

2007-03-08 Thread Lele Gaifax
Michael Bayer wrote: FB - ?? For what is worth, it actually accepts either a single positional argument or a `size` keyword argument. ciao, lele. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy

[sqlalchemy] Deleting an object from a database?

2007-03-08 Thread Andrea Gavana
Hi All, at the end, I finally cracked the problem with the tree-structured database with SQLAlchemy. I still have however a problem. I am using a physical database, not an in-memory one. I have declared my Tables as follows: trees = Table('treenodes', metadata,

[sqlalchemy] Re: Explicit column in a SelectResults qry.

2007-03-08 Thread Michael Bayer
we currently have this feature: http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_selects which can return a result with more than one entity per row. the hard part here is defining the select statement. SQLAlchemy doesnt know how to compile select statements that go across

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread svilen
This is the db-file size, which is actual DB-implemenation detail, and which will probably only grow up - depends on the particular db u have. There are many strategies, like paging etc. e.g. some DBs require a whole partition just for themselves - dont even think of shrinking those... See

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Andrea Gavana
Hi Svilen, first of all, thank you for your answer. On 3/8/07, svilen wrote: This is the db-file size, which is actual DB-implemenation detail, and which will probably only grow up - depends on the particular db u have. There are many strategies, like paging etc. e.g. some DBs require

[sqlalchemy] SA - Many-to-many relation through other 2 tables (like join_to/join_via)

2007-03-08 Thread Adam Hoscilo
Hi, I'm starting with SA so maybe I'm missing something. I've checked the docs few times but I didn't find a solution. I would like to have a many-to-many relation through a table. I have Feeds they are related many-to-many with Categories and one-to- many with FeedItems. I haven't found any

[sqlalchemy] What should the future of SQLAlchemy Query look like ?

2007-03-08 Thread Michael Bayer
hey list - I continue to be troubled by the slightly fragmented nature of SA's Query object (and the cousin SelectResults). When I work with Hibernate, I can see that their querying interface is a little more consistent than ours. We have flags that are used for some things, generative methods

[sqlalchemy] Re: SA - Many-to-many relation through other 2 tables (like join_to/join_via)

2007-03-08 Thread Michael Bayer
On Mar 8, 10:57 am, Adam Hoscilo [EMAIL PROTECTED] wrote: Hi, I'm starting with SA so maybe I'm missing something. I've checked the docs few times but I didn't find a solution. I would like to have a many-to-many relation through a table. I have Feeds they are related many-to-many with

[sqlalchemy] Re: What should the future of SQLAlchemy Query look like ?

2007-03-08 Thread Jonathan Ellis
On 3/8/07, Michael Bayer [EMAIL PROTECTED] wrote: hey list - I continue to be troubled by the slightly fragmented nature of SA's Query object (and the cousin SelectResults). When I work with Hibernate, I can see that their querying interface is a little more consistent than ours. We have

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Michael Bayer
On Mar 8, 2007, at 10:08 AM, Andrea Gavana wrote: By printing the node names, I know that bad_node is no more there, but its data seems to still live in the database. I mean, even if I delete *all* the items, the database size is still 180 Kb, no matter how much I flush(), clear(), close()

[sqlalchemy] Re: What should the future of SQLAlchemy Query look like ?

2007-03-08 Thread Michael Bayer
On Mar 8, 2007, at 11:22 AM, Jonathan Ellis wrote: On 3/8/07, Michael Bayer [EMAIL PROTECTED] wrote: hey list - I continue to be troubled by the slightly fragmented nature of SA's Query object (and the cousin SelectResults). When I work with Hibernate, I can see that their querying

[sqlalchemy] Re: What should the future of SQLAlchemy Query look like ?

2007-03-08 Thread Jonathan Ellis
On 3/8/07, Michael Bayer [EMAIL PROTECTED] wrote: how often do you have a base query hanging around, vs. doing brand new query object each time? with the full generative way, if you are programatically building up your query, now you have to say: if somecriterion: q =

[sqlalchemy] Re: What should the future of SQLAlchemy Query look like ?

2007-03-08 Thread Michael Bayer
On Mar 8, 2007, at 11:49 AM, Jonathan Ellis wrote: for instance, i have an application in charge of building zips for users to download from a queue of requests. the requests are prioritized, but to prevent starvation of low priority requests, i have another thread that just processes them

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Andrea Gavana
Hi Michael, On 3/8/07, Michael Bayer wrote: have you verified that the tables have been deleted from ? if the filesize doesnt shrink, that may be an artifact of sqlite's implementation. Thank you for your answer. Well, I can reproduce it in a small Python script that I attach to my email. At

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Michael Bayer
setting the newDataBase flag to False, heres the echo at the end: 2007-03-08 14:30:26,428 INFO sqlalchemy.engine.base.Engine.0x..50 BEGIN 2007-03-08 14:30:26,435 INFO sqlalchemy.engine.base.Engine.0x..50 DELETE FROM treenodes WHERE treenodes.node_id = ? 2007-03-08 14:30:26,441 INFO

[sqlalchemy] Re: Feature request: Session.get_local()

2007-03-08 Thread Michael Bayer
fine, but the name get_local is not so descriptive and also attracts the focus away from the existing identity_map accessor. how about we jack up the identity_map dictionary to be smarter ? so you could say: session.identity_map.find(class_, ident, entity_name='foo') On Mar 8, 10:07 am,

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Andrea Gavana
Hi Michael and All, thank you for your detailed answer, and to have tried the demo I have attached. I understand what you meant and you are perfectly right, but if I can bother you with another small question: On 3/8/07, Michael Bayer wrote: z-eeks-Computer:~/dev/sqlalchemy classic$

[sqlalchemy] Functions with out parameters?

2007-03-08 Thread Greg Copeland
This was cross posted to comp.lang.python because it would not let me join here. At any rate, I'm using engine.func.blah(1, 2, 3, error ).execute() and get: sqlalchemy.exceptions.SQLError: (DatabaseError) ORA-06572: Function blah has out arguments. Anthing special I need to do to call an Oracle

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Michael Bayer
On Mar 8, 2007, at 5:14 PM, Andrea Gavana wrote: so, its all deleted. filesize is irrelevant. Uhm, really? What happens if Windows is saying that the filesize is 4 GB of empty things? I told you I know next to nothing about database, but it seems a bit odd to me that the file size

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Andrea Gavana
Hi Michael, On 3/8/07, Michael Bayer wrote: but the point is, and why its irrelvant to me as the maintainer of SQLAlchemy, is that this is totally an issue with sqlite, and has nothing to do with SQLAlchemy. you should ask on their mailing list about this particular behavior. Sorry, I

[sqlalchemy] Re: Functions with out parameters?

2007-03-08 Thread Michael Bayer
we have a notion of how this feature can be implemented with oracle but the actual work has not been performed. i just put this notion into ticket #507 since I hadnt written it down anywhere. for now theres not really a good way to make it happen within SA's querying facilities; youd have

[sqlalchemy] Re: Deleting an object from a database?

2007-03-08 Thread Andrea Gavana
Hi Michael and All, On 3/8/07, Michael Bayer wrote: but the point is, and why its irrelvant to me as the maintainer of SQLAlchemy, is that this is totally an issue with sqlite, and has nothing to do with SQLAlchemy. you should ask on their mailing list about this particular behavior.

[sqlalchemy] Re: Print of returned object fails

2007-03-08 Thread Gloria
Ah, yes, I've noticed that this doesn't happen when I change this to use Psycopg2. So, we must finally make the switch. Anyone know how to compile Psycopg2 (with a compile flag, not by hackery) so that it does NOT fill in the tzinfo strcuture for timestamps with timezones? We pytz fans like our

[sqlalchemy] Compressing cPickled objects == store in DB

2007-03-08 Thread Andrea Gavana
Hi All, I was wondering if it is possible to use zlib.compress() to compress a cPickled object and store it into a database, and then retrieve it using zlib.decompress(). I have tried for a while, but I keep getting errors like: snip File build\bdist.win32\egg\sqlalchemy\engine\base.py,

[sqlalchemy] InstrumentedList is not a list

2007-03-08 Thread kris
sqlalchemy.orm.attributes.InstrumentedList I was wondering why instrumentedList is derived from 'object' instead of 'list'? I working with some introspection code and it fails on attributes of type InstrumentedList because of this. Thanks, kris