public inbox for [email protected]
help / color / mirror / Atom feedFrom: Daniele Varrazzo <[email protected]>
To: Psycopg <[email protected]>
Subject: Psycopg 3.3.0.dev1 released - with Template Strings support!
Date: Tue, 9 Sep 2025 09:52:47 +0200
Message-ID: <CA+mi_8Y0iOsQWJKMU2B=ek8ETOmAaA+dm5LsSQbLDq4wFWrtOQ@mail.gmail.com> (raw)
Hello,
I have released a preview version of Psycopg 3.3.0 on test pypi. You
can install it using:
pip install -i https://test.pypi.org/simple/ "psycopg[binary]==3.3.0.dev1"
This version allows writing queries as template strings, a new
language feature released with Python 3.14. The use of t-string in
Psycopg is documented at
<https://www.psycopg.org/psycopg3/docs/basic/tstrings.html;.
Template strings allow to express parametrized queries using the same
syntax of f-strings, but allowing Psycopg to manage the arguments,
either for server-side or for client-side binding - easily both at the
same time. For example a query like the following will have the table
name merged on the client and the id parameter sent separately,
eventually even after the statement is prepared internally:
cursor.execute(t"SELECT * FROM {table_name:i} WHERE id = {id}")
Using t-strings eliminates the need to keep lists of query
placeholders and parameters in sync, making queries easier to read and
to maintain.
I am really excited about this new language feature and I hope that
the support we designed for Psycopg will make the most of it!
Therefore we are releasing preview packages to allow wider testing and
gather feedback before a final 3.3 release.
Feedback is very welcome. Happy hacking!
-- Daniele
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Psycopg 3.3.0.dev1 released - with Template Strings support!
In-Reply-To: <CA+mi_8Y0iOsQWJKMU2B=ek8ETOmAaA+dm5LsSQbLDq4wFWrtOQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox