Re: [sqlalchemy] mapper on a temporary class

2021-01-27 Thread Kent Bower
Excellent. As always, thanks very much for your time and answers (let alone awesome software)! On Wed, Jan 27, 2021 at 1:25 PM Mike Bayer wrote: > > > On Tue, Jan 26, 2021, at 9:01 PM, Kent Bower wrote: > > Thanks a ton for your responses. > > Do all the normal columns of an aliased class

Re: [sqlalchemy] mapper on a temporary class

2021-01-27 Thread Mike Bayer
On Tue, Jan 26, 2021, at 9:01 PM, Kent Bower wrote: > Thanks a ton for your responses. > > Do all the normal columns of an aliased class need to match the ad-hoc select > to which I map the alias? handwavy handwavy sort of yes, sort of no?there needs to be a 1-1 correspondence of

Re: [sqlalchemy] mapper on a temporary class

2021-01-26 Thread Kent Bower
Thanks a ton for your responses. Do all the normal columns of an aliased class need to match the ad-hoc select to which I map the alias? > oh if the class doesn't have a mapper, then defintiely, just make ad-hoc subclasses of it and map to those.vastly easier that way. Mapping to a subclass

Re: [sqlalchemy] mapper on a temporary class

2021-01-26 Thread Mike Bayer
On Tue, Jan 26, 2021, at 7:31 PM, Kent Bower wrote: > I should have given these details from the get-go: the use case is a > specialized select() (dynamically built) which would be extremely convenient > to map relationships against for convenience in subquery loading, etc. So, > the class

Re: [sqlalchemy] mapper on a temporary class

2021-01-26 Thread Mike Bayer
On Tue, Jan 26, 2021, at 7:31 PM, Kent Bower wrote: > I should have given these details from the get-go: the use case is a > specialized select() (dynamically built) which would be extremely convenient > to map relationships against for convenience in subquery loading, etc. So, > the class

Re: [sqlalchemy] mapper on a temporary class

2021-01-26 Thread Kent Bower
I should have given these details from the get-go: the use case is a specialized select() (dynamically built) which would be extremely convenient to map relationships against for convenience in subquery loading, etc. So, the class would not already have a mapper. Can I pass non_primary=True

Re: [sqlalchemy] mapper on a temporary class

2021-01-26 Thread Mike Bayer
On Tue, Jan 26, 2021, at 3:16 PM, Kent wrote: > Question: if I add a mapper to a class that is only needed temporarily, does > using the mapper compile it along side my "normal" mappers such that I'll > leak memory when I mean for the class to be garbage collected? > > Put another way, can I

[sqlalchemy] mapper on a temporary class

2021-01-26 Thread Kent
Question: if I add a mapper to a class that is only needed temporarily, does using the mapper compile it along side my "normal" mappers such that I'll leak memory when I mean for the class to be garbage collected? Put another way, can I add a mapper to a class that doesn't influence my "main