Re: [sqlalchemy] Re: testing patterns with sqlalchemy 2.0

2022-09-02 Thread Elmer de Looff
On Fri, Sep 2, 2022, 08:47 Chris Withers wrote: > On 01/09/2022 20:00, Jonathan Vanasco wrote: > > > > > Create an empty schema from the models using create_all? > > > > This is what I usually do with smaller projects. > > When taking this approach, how do you ensure the accumulated schema >

Re: [sqlalchemy] Injecting User info into _history table to track who performed the change

2021-03-12 Thread Elmer de Looff
Hi JP, Depending on how you've implemented your history tracking, that routine is quite far removed from your web framework and getting a neat, clean way of dealing with that might not be within reach. However, most web frameworks have some concept of a threadlocal request (or function to

Re: [sqlalchemy] AWS RDS generate-db-auth-token and Redshift get-cluster-credentials

2020-05-22 Thread Elmer de Looff
For reference, we've used this engine strategy for a while, which seems to get the job done. We're strictly on Postgres so the code could do with some alterations to make it compatible with multiple backends, that's left as an exercise to the reader :-) The main work is done in

Re: [sqlalchemy] composite secondary join variant

2020-04-24 Thread Elmer de Looff
Hi Jonathan, >From toying with it a little bit, it looks like you *need* to specify a secondaryjoin when you specify the secondary table. In your example, the secondary does some of the work that the secondaryjoin would need to do. I've created a gist that mirrors your table setup (with some more

Re: [sqlalchemy] Large RAM usage in bulk_insert_mappings

2019-11-15 Thread Elmer de Looff
I'm not even sure the problem is with the batch insert function itself, creating half a million dicts in Python is going to cause you a bit of a bad time. That said, I've run into the same problem with a little toy project, which works around this with a 'bulk save' interface. With a minimal

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-12 Thread Elmer de Looff
has an .as_scalar() method; but then removing as_scalar() altogether from that query yielded a correct query, so something (excellent) has changed there in 1.4 On Fri, Aug 9, 2019 at 11:29 AM Elmer de Looff wrote: > I've been milling over your comment regarding the func.array vs ar

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-09 Thread Elmer de Looff
seems fairly wedded to the concept of being a literal array (looking at the superclass) for now, so my suggested extension might be a bit easier said than implemented. On Thu, Aug 8, 2019 at 7:05 PM Mike Bayer wrote: > > > On Thu, Aug 8, 2019, at 11:56 AM, Elmer de Looff wrote: &

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-08 Thread Elmer de Looff
. I'd be happy to take a stab at an entry if you're interested. On Thu, Aug 8, 2019 at 5:17 PM Mike Bayer wrote: > > > On Thu, Aug 8, 2019, at 9:48 AM, Elmer de Looff wrote: > > Hi, > > I'm trying to create a query to check whether a small number of given keys > are all pr

[sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-08 Thread Elmer de Looff
Hi, I'm trying to create a query to check whether a small number of given keys are all present within a selection of a table. Postgres provides array types/functions for this to check sub/superset properties, which seem to do what I want. The query I'm trying to create is one of the following