[sqlalchemy] Reflect from one engine, use reflected tables in different engine

2015-08-07 Thread Luis Guzman
Hi, Is it possible to reflect from one engine and then use some of the tables reflected as base to create tables in a second, different engine? A possible way: A_engine = create_engine(postgresql+psycopg2://...A...) B_engine = create_engine(postgresql+psycopg2://...B...) A_metadata =

[sqlalchemy] Re: mysql, use password from my.cnf file

2015-08-07 Thread Balaji Pattewar
Hi , Iam trying to use from sqlalchemy.engine.url import URL myDB = URL(drivername='mysql', host='localhost', database='my_database_name', query={ 'read_default_file' : '/path/to/.my.cnf' } ) engine = create_engine(name_or_url= myDB) but it is not working form me. The error I am

[sqlalchemy] Configuring a self-referential relationship with cumstom foreign conditions

2015-08-07 Thread SElsner
Hello, I am trying to create a declarative calss, which is self referential and uses a custom primaryjoin condition, involving other columns like a is_deleted column: class Item(Base): __tablename__ = items uuid = Column(UUID(), primary_key=True) is_deleted = Column(Boolean,

Re: [sqlalchemy] What's the idiomatic way of writing INSERT... ON DUPLICATE KEY UPDATE

2015-08-07 Thread vitaly numenta
Has support for MySQL INSERT... ON DUPLICATE KEY UPDATE been integrated into sqlalchemy more recently? Thanks, Vitaly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread kk
On Friday 07 August 2015 10:05 PM, Claudio Freire wrote: On Fri, Aug 7, 2015 at 12:51 PM, Mike Bayer mike...@zzzcomputing.com wrote: On 8/7/15 11:05 AM, kk wrote: On Friday 07 August 2015 03:03 PM, Ladislav Lenart wrote: Hello. ORM is certainly slower. How much depends A LOT on your

Re: [sqlalchemy] What's the idiomatic way of writing INSERT... ON DUPLICATE KEY UPDATE

2015-08-07 Thread Mike Bayer
On 8/7/15 5:25 PM, vitaly numenta wrote: Has support for MySQL INSERT... ON DUPLICATE KEY UPDATE been integrated into sqlalchemy more recently? no. Thanks, Vitaly -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this

[sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread kk
Dear all, I am planning to totally revamp my rdbms model and totally migrate to sqlalchemy. Right now we have a lot of stored procedurs for obvious performance benefits. However it is becoming more and more difficult to maintain the system and also difficult to migrate existing users when

Re: [sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread Ladislav Lenart
Hello. ORM is certainly slower. How much depends A LOT on your workload. For example bulk operations with ORM are an order of magnitude slower than raw SQL. On the other hand, SQLAlchemy Core let's you write generative SQL queries without ORM features which are as performant as raw SQL. Overall

Re: [sqlalchemy] how to tell which tables already joined in a query statement (or best way to dynamically build a query?)

2015-08-07 Thread Mike Bayer
On 8/7/15 10:35 AM, Brian Cherinka wrote: Hi, I'm trying to build an SQLalchemy ORM query dynamically based on user selected options. Some of these options come from the same table, but the user could select either one or both criteria to filter on. Since I don't know which options the

[sqlalchemy] how to tell which tables already joined in a query statement (or best way to dynamically build a query?)

2015-08-07 Thread Brian Cherinka
Hi, I'm trying to build an SQLalchemy ORM query dynamically based on user selected options. Some of these options come from the same table, but the user could select either one or both criteria to filter on. Since I don't know which options the user will select ahead of time, I have to

Re: [sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread kk
On Friday 07 August 2015 03:03 PM, Ladislav Lenart wrote: Hello. ORM is certainly slower. How much depends A LOT on your workload. For example bulk operations with ORM are an order of magnitude slower than raw SQL. On the other hand, SQLAlchemy Core let's you write generative SQL queries

Re: [sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread Claudio Freire
On Fri, Aug 7, 2015 at 12:05 PM, kk krm...@gmail.com wrote: On Friday 07 August 2015 03:03 PM, Ladislav Lenart wrote: Hello. ORM is certainly slower. How much depends A LOT on your workload. For example bulk operations with ORM are an order of magnitude slower than raw SQL. On the other

Re: [sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread Claudio Freire
On Fri, Aug 7, 2015 at 12:51 PM, Mike Bayer mike...@zzzcomputing.com wrote: On 8/7/15 11:05 AM, kk wrote: On Friday 07 August 2015 03:03 PM, Ladislav Lenart wrote: Hello. ORM is certainly slower. How much depends A LOT on your workload. For example bulk operations with ORM are an order

[sqlalchemy] Instrumenting an object after the fact

2015-08-07 Thread buchuki
Hi there, I'm trying to do something pretty weird. I have SQLAlchemy instrumented classes that extend a class in addition to Base, like so: class Region(Base, t_Region): __tablename__ = 'region' id = Column( mysql.INTEGER(11), primary_key=True, nullable=False,

Re: [sqlalchemy] Instrumenting an object after the fact

2015-08-07 Thread Mike Bayer
On 8/7/15 2:10 PM, buch...@gmail.com wrote: Hi there, I'm trying to do something pretty weird. I have SQLAlchemy instrumented classes that extend a class in addition to Base, like so: class Region(Base, t_Region): __tablename__ = 'region' id = Column( mysql.INTEGER(11),

[sqlalchemy] Re: Instrumenting an object after the fact

2015-08-07 Thread buchuki
Thanks for the insights! I'll carry on with this and see what I can make happen. I'm not able to introduce a factory pattern at the point Region object is created without monkeypatching an external library. However, I'm now going to explore instrumenting that class using mapper() instead of

Re: [sqlalchemy] how fast can pure sqlalchemy perform?

2015-08-07 Thread Mike Bayer
On 8/7/15 11:05 AM, kk wrote: On Friday 07 August 2015 03:03 PM, Ladislav Lenart wrote: Hello. ORM is certainly slower. How much depends A LOT on your workload. For example bulk operations with ORM are an order of magnitude slower than raw SQL. On the other hand, SQLAlchemy Core let's

Re: [sqlalchemy] Configuring a self-referential relationship with cumstom foreign conditions

2015-08-07 Thread Mike Bayer
On 8/7/15 5:05 PM, SElsner wrote: Hello, I am trying to create a declarative calss, which is self referential and uses a custom primaryjoin condition, involving other columns like a is_deleted column: class Item(Base): __tablename__ = items uuid = Column(UUID(),