]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add new str` subclass for postgresql bitstring
authorFederico Caselli <cfederico87@gmail.com>
Fri, 20 Jun 2025 20:28:45 +0000 (22:28 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 2 Jul 2025 02:44:41 +0000 (22:44 -0400)
commitbaec9a3ac8fd675307026dca81b96a8f2102efa2
treeee450bfdf2895d3c9beae5b4360e0b5010529c6a
parent5394c75bcac270905a58a0fb7cd5f0d6643f78fd
Add new str` subclass for postgresql bitstring

Adds a new ``str`` subclass :class:`dialects.postgresql.BitString`
representing PostgreSQL bitstrings in python, that includes
functionality for converting to and from ``int`` and ``bytes``, in
addition to implementing utility methods and operators for dealing
with bits.

This new class is returned automatically by the :class:`postgresql.BIT`
type.

Fixes: #10556
Closes: #12594
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12594
Pull-request-sha: da47f40739ff9fc6e75da44bd1663aadf80e93ca

Change-Id: I64685660527c23666f7351b2c393fa86dfb643ea
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/10556.rst [new file with mode: 0644]
doc/build/dialects/postgresql.rst
lib/sqlalchemy/dialects/postgresql/__init__.py
lib/sqlalchemy/dialects/postgresql/asyncpg.py
lib/sqlalchemy/dialects/postgresql/bitstring.py [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/types.py
test/dialect/postgresql/test_bitstring.py [new file with mode: 0644]
test/dialect/postgresql/test_types.py