Re: [sqlalchemy] Dogpile session caching

2023-08-02 Thread Mike Bayer
I will note, in case you didn't see it, that in SQLAlchemy 1.4 (as well as in 
2.0) the caching mechanics themselves have changed compared to what they were 
in SQLAlchemy 1.3.  This change was first made in the 1.4 series to use the new 
do_orm_execute() event model, whereas previously in 1.3 there was a Query 
subclass called CachingQuery or something like that.   for 1.4 and above you 
would need to be using the do_orm_execute() code.

On Wed, Aug 2, 2023, at 11:43 PM, Mike Bayer wrote:
> I've just updated them to use new style queries.   There were no issues and 
> all the examples work by switching `Session.query(Thing)` for 
> `Session.scalars(select(Thing))`. The examples will be on the site within 
> an hour but you can see the changes made in 
> https://github.com/sqlalchemy/sqlalchemy/commit/ab413c3c7b655d408d925dfba47f54c207b9668b
>  .
> 
> 
> 
> On Wed, Aug 2, 2023, at 2:05 PM, 'Joe Black' via sqlalchemy wrote:
>> Hello,
>> 
>> First of all, excellent project!  It's such a powerful tool when you really 
>> master the internals, and after several years I think I'm nearing that 
>> point.  
>> 
>> My question today is related to the dogpile caching example 
>> s.
>>   I migrated to 2.x awhile back but the given examples in the documentation 
>> for 2.x show the Session.query interface being used.  I understand this has 
>> been deprecated starting with 2.x, so naturally I've migrated existing code 
>> using Session.query.  This seems to break the example code for dogpile 
>> caching.
>> 
>> I was hoping to get some advice on how to implement the caching using the 
>> new unified sa.select and Session.execute/Session.scalars interface, or even 
>> whether dogpile cache supports this interface yet?
>> 
>> Thanks in advance,
>> 
>> Joe
>> 
>> 
>> --
>> SQLAlchemy -
>> The Python SQL Toolkit and Object Relational Mapper
>>  
>> http://www.sqlalchemy.org/
>>  
>> To post example code, please provide an MCVE: Minimal, Complete, and 
>> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
>> description.
>> ---
>> 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 to sqlalchemy+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sqlalchemy/29559c02-782b-4d71-be75-82494c5f253dn%40googlegroups.com
>>  
>> .
> 
> 
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> 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 to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/42ae3b77-3bdf-4ee4-a571-086a3a06a8ba%40app.fastmail.com
>  
> .

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/ba2c7c0a-821b-42db-b85f-f9a7bde9a1f0%40app.fastmail.com.


Re: [sqlalchemy] Dogpile session caching

2023-08-02 Thread Mike Bayer
I've just updated them to use new style queries.   There were no issues and all 
the examples work by switching `Session.query(Thing)` for 
`Session.scalars(select(Thing))`. The examples will be on the site within 
an hour but you can see the changes made in 
https://github.com/sqlalchemy/sqlalchemy/commit/ab413c3c7b655d408d925dfba47f54c207b9668b
 .



On Wed, Aug 2, 2023, at 2:05 PM, 'Joe Black' via sqlalchemy wrote:
> Hello,
> 
> First of all, excellent project!  It's such a powerful tool when you really 
> master the internals, and after several years I think I'm nearing that point. 
>  
> 
> My question today is related to the dogpile caching example 
> s.
>   I migrated to 2.x awhile back but the given examples in the documentation 
> for 2.x show the Session.query interface being used.  I understand this has 
> been deprecated starting with 2.x, so naturally I've migrated existing code 
> using Session.query.  This seems to break the example code for dogpile 
> caching.
> 
> I was hoping to get some advice on how to implement the caching using the new 
> unified sa.select and Session.execute/Session.scalars interface, or even 
> whether dogpile cache supports this interface yet?
> 
> Thanks in advance,
> 
> Joe
> 
> 
> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> 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 to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/29559c02-782b-4d71-be75-82494c5f253dn%40googlegroups.com
>  
> .

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/42ae3b77-3bdf-4ee4-a571-086a3a06a8ba%40app.fastmail.com.


[sqlalchemy] Dogpile session caching

2023-08-02 Thread 'Joe Black' via sqlalchemy
Hello,

First of all, excellent project!  It's such a powerful tool when you really 
master the internals, and after several years I think I'm nearing that 
point.  

My question today is related to the dogpile caching example 
s.
  
I migrated to 2.x awhile back but the given examples in the documentation 
for 2.x show the Session.query interface being used.  I understand this has 
been deprecated starting with 2.x, so naturally I've migrated existing code 
using Session.query.  This seems to break the example code for dogpile 
caching.

I was hoping to get some advice on how to implement the caching using the 
new unified sa.select and Session.execute/Session.scalars interface, or 
even whether dogpile cache supports this interface yet?

Thanks in advance,

Joe

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/29559c02-782b-4d71-be75-82494c5f253dn%40googlegroups.com.