Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-25 Thread Mike Bayer
On Tue, Jun 25, 2019, at 10:30 PM, Julien Cigar wrote: > Just to add that it works like a charm, even with recursive queries. > I have a classical parent->child relationship (website structure) and I > am able to retrieve the whole structure, including translations (with > fallback on a default o

Re: [sqlalchemy] Re: How to connect to Amazon Redshift and Presto using SQLAlchemy?

2019-06-25 Thread Mike Bayer
please communicate with the sqlalchemy-redshift folks at https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues as I know nothing about what special options it offers On Tue, Jun 25, 2019, at 10:30 PM, Preutti Puawade wrote: > Hi, > > When I set engine as below, > > engine = > sa.c

[sqlalchemy] Re: How to connect to Amazon Redshift and Presto using SQLAlchemy?

2019-06-25 Thread Preutti Puawade
Hi I'm trying to connect like this engine = sa.create_engine('redshift+psycopg2://u...@hgst-edm-oregon-prod02.cgdmyxu24bfx.us-west-2.redshift.amazonaws.com:5439/bdpdw?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory') no error came up print(engine.table_names())

Re: [sqlalchemy] primaryjoin and remote/foreign sides

2019-06-25 Thread Julien Cigar
Just to add that it works like a charm, even with recursive queries. I have a classical parent->child relationship (website structure) and I am able to retrieve the whole structure, including translations (with fallback on a default one) in just _one_ query, this is really amazing :) this is with

[sqlalchemy] Re: How to connect to Amazon Redshift and Presto using SQLAlchemy?

2019-06-25 Thread Preutti Puawade
Hi, When I set engine as below, engine = sa.create_engine('redshift+psycopg2://usern...@xxx-edm-oregon-prod02.cgdmyxu24bfx.us-west-2.redshift.amazonaws.com:5439/bdpdw?tcpKeepAlive=true&ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory') it's no error. But when I try to print(engine.

Re: [sqlalchemy] How to inspect filters

2019-06-25 Thread Andrew Martin
Thank you, as always, for both the specific answer and the general advice. Much appreciated! On Sunday, June 23, 2019 at 5:19:49 PM UTC-5, Mike Bayer wrote: > > > > On Sun, Jun 23, 2019, at 5:45 PM, Andrew Martin wrote: > > I have a generic CRUDService for my web app. It's a pattern that was > l

[sqlalchemy] Limiting Relationship Depths

2019-06-25 Thread Michael P. McDonnell
Hey team - I was wondering - is it possible to limit the depth of objects by which SA will populate members? Say I have a Person who is on a Team that plays a Game class Person(Base): # . team = relationship("Team", uselist=False) class Team(Base): # . game = relationship("Game",

Re: [sqlalchemy] Where clause when using polymorphic_identity on base class

2019-06-25 Thread Mike Bayer
On Fri, Jun 21, 2019, at 7:22 AM, Dmytro Starosud wrote: > Base class `A1` contains `polymorphic_identity` (along with > `polymorphic_on`), but `Query(A1)`doesn't produce where clause, whereas > `Query(A2)` (where `A2` is subclass of `A1` with its own > `polymorphic_identity`) does. > Tried l

Re: [sqlalchemy] Where clause when using polymorphic_identity on base class

2019-06-25 Thread Dmytro Starosud
Thank you Simon. I think you're right. I should better ask another question, instead of enrolling XY problem here (in short I need to add particular filter to each model). But let's wrap up with this one. Did I understand correctly that I *cannot* have two following things simultaneously: 1. polym