[sqlalchemy] Async Event Listeners

2022-02-24 Thread Brendan Blanchard
Hi all, I've been having a lot of fun trying to optimize an async data retrieval system, but am in need of tracking when connections are checked in and out so I can debug overloading the connection pool. The documentation was of course helpful in the synchronous case for adding listeners on

Re: [sqlalchemy] Location of "string lookup" for classes in a declarative base?

2021-05-27 Thread Brendan Blanchard
you can do now is use sqlalchemy.orm.registry explicitly for your > mappings, your class name lookup is in there right now in > registry._class_registry > > On Thu, May 27, 2021, at 11:21 AM, Brendan Blanchard wrote: > > > Hi all, > > I'm using a class factory to dynamically generate SQ

[sqlalchemy] Location of "string lookup" for classes in a declarative base?

2021-05-27 Thread Brendan Blanchard
Hi all, I'm using a class factory to dynamically generate SQLA types and am rightfully getting the warning: *SAWarning: This declarative base already contains a class with the same class name and module name as , and will be replaced in the string-lookup table.* when I attempt to use it

Re: [sqlalchemy] Dynamically creating relationships from polymorphic subclasses to one class

2020-08-07 Thread Brendan Blanchard
Aug 6, 2020, at 5:11 PM, Brendan Blanchard wrote: > > I think I've misunderstood the usage of extend_existing=True on a table, > but from my reading today it sounds like it will only have an effect on > building up a table definition prior to calling create_all() on the > metadata?

Re: [sqlalchemy] Dynamically creating relationships from polymorphic subclasses to one class

2020-08-06 Thread Brendan Blanchard
objects being created (or, if more are added later, modify the DB accordingly)? On Thu, Aug 6, 2020 at 4:59 PM Mike Bayer wrote: > > > On Thu, Aug 6, 2020, at 3:45 PM, Brendan Blanchard wrote: > > I'm now having a problem with the actual implementation of this beyond the > test c

Re: [sqlalchemy] Dynamically creating relationships from polymorphic subclasses to one class

2020-08-06 Thread Brendan Blanchard
t_solar_watt_average, met.solar_kj_total AS met_solar_kj_total, > met.relative_humidity AS met_relative_humidity, met.id AS met_id, met.site > AS met_site, met.type AS met_type, met.blvmetstats1hour_id AS > met_blvmetstats1hour_id, met.blvmetstats1month_id AS > met_blvmetstats

Re: [sqlalchemy] Dynamically creating relationships from polymorphic subclasses to one class

2020-08-01 Thread Brendan Blanchard
; back_populates=f"{cls_name}Rel", > foreign_keys=f"[{member_cls.__name__}.{fk_col}]", > ), > ) > > > > > > On Sat, Aug 1, 2020, at 1:54 PM, Brendan Blanchard wrote: > > I have SQLA classes in a project that h

[sqlalchemy] Dynamically creating relationships from polymorphic subclasses to one class

2020-08-01 Thread Brendan Blanchard
I have SQLA classes in a project that have date and data components and I'm attempting to create a single base-class that I can subclass to create statistics for all points of data during some interval, but I want the interval subclasses to maintain references to their sub-data such that if I