[sqlalchemy] Re: new LIMIT/OFFSET Support for oracle - huge speed penalty

2010-07-07 Thread Ralph Heinkel
Hi, sorry for the late reply. I've now made some measurements, and repeated those two a couple times to avoid caching effects. I've reduced it to the innermost sql statement. Here they are: SELECT entrypoint_id, ...20 about fields ..., ROW_NUMBER() OVER (ORDER BY creationdate DESC, entrypoint_id

[sqlalchemy] Why does SA (only 0.6.x) read data from n:m relationships when updating the parent table?

2010-07-07 Thread Ralph Heinkel
Hi, is SA 0.6 this problem did not occur. The sample code to demonstrate the problem is taken from http://www.sqlalchemy.org/docs/mappers.html#many-to-many and repeated here for completeness. First let's setup a sample db (all done in sqlite in my case): class Parent(object): def

Re: [sqlalchemy] doing stuff in MapperExtension's before_insert and before_update

2010-07-07 Thread Chris Withers
Michael Bayer wrote: The recursion overflow is fixed and make_transient now removes expiration flags. In the latest tip you can now say: session.expire(object, ['id']) make_transient(object) or alternatively: make_transient(object) object.id = None and the

Re: [sqlalchemy] SQLAlchemy 0.6.2 Released

2010-07-07 Thread Chris Withers
Michael Bayer wrote: - Declarative mixins can do everything now. You need to use sqlalchemy.util.classproperty in most cases to do it. Cool, but the spelling is a little cumbersome: class MyMixin: @classproperty def type_(cls): return Column(String(50)) It'd feel more

Re: [sqlalchemy] SQLAlchemy 0.6.2 Released

2010-07-07 Thread Michael Bayer
On Jul 7, 2010, at 5:38 AM, Chris Withers wrote: Michael Bayer wrote: - Declarative mixins can do everything now. You need to use sqlalchemy.util.classproperty in most cases to do it. Cool, but the spelling is a little cumbersome: class MyMixin: @classproperty def

Re: [sqlalchemy] doing stuff in MapperExtension's before_insert and before_update

2010-07-07 Thread Michael Bayer
On Jul 7, 2010, at 5:40 AM, Chris Withers wrote: Michael Bayer wrote: The recursion overflow is fixed and make_transient now removes expiration flags. In the latest tip you can now say: session.expire(object, ['id']) make_transient(object) or alternatively:

Re: [sqlalchemy] remapping column type

2010-07-07 Thread Michael Bayer
On Jul 7, 2010, at 1:30 AM, Lance Edgar wrote: Hi, I was wondering what method might be used (assuming it's possible) to redefine a column's attribute type after the mapping has already been made? Specifically I have the following scenario: from sqlalchemy import * from sqlalchemy.orm

Re: [sqlalchemy] SQLAlchemy 0.6.2 Released

2010-07-07 Thread Chris Withers
Michael Bayer wrote: mixin(foo) is the most practical of the ideas above, but someone can easily create that themselves. Indeed,, I was just wondering if this should be in the core and the recommended way of doing this? Chris -- You received this message because you are subscribed to the

[sqlalchemy] Re: Why does SA (only 0.6.x) read data from n:m relationships when updating the parent table?

2010-07-07 Thread Ralph Heinkel
oh, I'm sorry, but better now than later ;-) Strange that nobody got hit by that bug (or the side effects were not as tremendous as in my case and so they were silently going through with no harm ...) Thanks anyway for looking at this and fixing the problem. Ciao ciao Ralph On Jul 7, 4:08 pm,

Re: [sqlalchemy] doing stuff in MapperExtension's before_insert and before_update

2010-07-07 Thread Chris Withers
Michael Bayer wrote: Did this make it into 0.6.2? If so, I'll update the recipe... yeah and the recipe should be up to date. Cool :-) Chris -- Simplistix - Content Management, Batch Processing Python Consulting - http://www.simplistix.co.uk -- You received this message

[sqlalchemy] Using the declarative base across projects

2010-07-07 Thread thatsanicehatyouhave
Hi, I have a question that I can't find a satisfactory answer to. Apologies in advance if it's more of a Python question, but it's possible that there is a SA solution. I have a project that defines a database connection and classes based on database tables. A script that uses these classes

Re: [sqlalchemy] Using the declarative base across projects

2010-07-07 Thread Lance Edgar
On Wed, 2010-07-07 at 11:13 -0400, thatsanicehatyouh...@mac.com wrote: Hi, I have a question that I can't find a satisfactory answer to. Apologies in advance if it's more of a Python question, but it's possible that there is a SA solution. I have a project that defines a database

Re: [sqlalchemy] Re: Why does SA (only 0.6.x) read data from n:m relationships when updating the parent table?

2010-07-07 Thread Michael Bayer
can you try out the latest hg tip for me please, I still feel like releasing this today: http://hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz On Jul 7, 2010, at 10:49 AM, Ralph Heinkel wrote: oh, I'm sorry, but better now than later ;-) Strange that nobody got hit by that bug (or the

[sqlalchemy] Re: remapping column type

2010-07-07 Thread Lance Edgar
On Jul 7, 8:56 am, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 7, 2010, at 1:30 AM, Lance Edgar wrote: Hi, I was wondering what method might be used (assuming it's possible) to redefine a column's attribute type after the mapping has already been made?  Specifically I have the

[sqlalchemy] Is ORM the right choice for large scale data manipulation?

2010-07-07 Thread Krishnakant Mane
Hello all, I will be interested to know if using ORM for a large scale data operation is the right approach when it comes to scalability. Has SQLAlchemy been put to test ever for a select query which involves getting thousands of records and specially when joins are involved? I have a

Re: [sqlalchemy] Re: Why does SA (only 0.6.x) read data from n:m relationships when updating the parent table?

2010-07-07 Thread Chris Withers
Michael Bayer wrote: can you try out the latest hg tip for me please, I still feel like releasing this today: http://hg.sqlalchemy.org/sqlalchemy/archive/default.tar.gz I've got a brown bag you can borrow if it's that serious ;-) Chris -- Simplistix - Content Management, Batch Processing

Re: [sqlalchemy] Is ORM the right choice for large scale data manipulation?

2010-07-07 Thread Michael Bayer
On Jul 7, 2010, at 2:10 PM, Krishnakant Mane wrote: Hello all, I will be interested to know if using ORM for a large scale data operation is the right approach when it comes to scalability. Has SQLAlchemy been put to test ever for a select query which involves getting thousands of records

Re: [sqlalchemy] Re: remapping column type

2010-07-07 Thread Michael Bayer
On Jul 7, 2010, at 1:53 PM, Lance Edgar wrote: OMichael, thanks for the tip. I still found this somewhat confusing though: When my code runs, the mapper has already been created (and compiled, I assume). So what I ended up doing, that seemed to work, is:

[sqlalchemy] Composite column with a relationship

2010-07-07 Thread Nikolaj
Hi there, I'd like to create a column composite for amounts of money and their currency. However, the difficulty comes in keeping the currencies in a separate table and enabling my composite to find this relationship. Is there some way to set the Currency on my Money type implementation

Re: [sqlalchemy] Using the declarative base across projects

2010-07-07 Thread thatsanicehatyouhave
Hi Lance, Thanks for your comments. On Jul 7, 2010, at 12:28 PM, Lance Edgar wrote: Why not just do this in project2 ? import project.DatabaseConnection as db Base = declarative_base(bind=db.engine) # ... etc. The DatabaseConnection class contains the particulars of the connection

Re: [sqlalchemy] Is ORM the right choice for large scale data manipulation?

2010-07-07 Thread Adam Tauno Williams
On Wed, 2010-07-07 at 23:40 +0530, Krishnakant Mane wrote: I will be interested to know if using ORM for a large scale data operation is the right approach when it comes to scalability. Has SQLAlchemy been put to test ever for a select query which involves getting thousands of records and

[sqlalchemy] Comparable properties

2010-07-07 Thread Oliver Beattie
Hi, I am just wondering if it is possible to allow a declarative object to have some of its properties comparable as if they were ClauseElements. I know I'm not explaining myself terrifically well here, but consider the following property: @property def is_visible(self): return

[sqlalchemy] Re: remapping column type

2010-07-07 Thread Lance Edgar
On Jul 7, 2:01 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 7, 2010, at 1:53 PM, Lance Edgar wrote: OMichael, thanks for the tip.  I still found this somewhat confusing though: When my code runs, the mapper has already been created (and compiled, I assume).  So what I

Re: [sqlalchemy] Re: remapping column type

2010-07-07 Thread Michael Bayer
On Jul 7, 2010, at 6:30 PM, Lance Edgar wrote: On Jul 7, 2:01 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 7, 2010, at 1:53 PM, Lance Edgar wrote: OMichael, thanks for the tip. I still found this somewhat confusing though: When my code runs, the mapper has already been

Re: [sqlalchemy] Re: remapping column type

2010-07-07 Thread Lance Edgar
On Wed, 2010-07-07 at 18:45 -0400, Michael Bayer wrote: On Jul 7, 2010, at 6:30 PM, Lance Edgar wrote: On Jul 7, 2:01 pm, Michael Bayer mike...@zzzcomputing.com wrote: On Jul 7, 2010, at 1:53 PM, Lance Edgar wrote: OMichael, thanks for the tip. I still found this somewhat

[sqlalchemy] Textmate Bundle

2010-07-07 Thread ucsd_surfNerd
Does anyone know of a TextMate bundle for SQLAlchemy. All of the links I have found on google for bundles are expired -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe

[sqlalchemy] blocking on Base.metadata.drop_all() in test

2010-07-07 Thread zende
Base.metadata.drop_all() completely blocks in the tearDown method of some of my tests. Session is defined with scoped_session(sessionmaker()) Any ideas how to get around this? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group,