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 
> <https://docs.sqlalchemy.org/en/20/_modules/examples/dogpile_caching/local_session_caching.html>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
>  
> <https://groups.google.com/d/msgid/sqlalchemy/29559c02-782b-4d71-be75-82494c5f253dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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.

Reply via email to