summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-02-11 04:54:45 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-06-01 11:40:56 -0400
commit349a7c5e0e2aeeac98fad789b0043a4bdfeed837 (patch)
tree20c314304023752e4cd7bc7894f042cc7b9d7064 /lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
parent4fb6aca6cfc593c64cd7102cd70924d1b7caea05 (diff)
downloadsqlalchemy-349a7c5e0e2aeeac98fad789b0043a4bdfeed837.tar.gz
add backend agnostic UUID datatype
Added new backend-agnostic :class:`_types.Uuid` datatype generalized from the PostgreSQL dialects to now be a core type, as well as migrated :class:`_types.UUID` from the PostgreSQL dialect. Thanks to Trevor Gross for the help on this. also includes: * corrects some missing behaviors in the suite literal fixtures test where row round trips weren't being correctly asserted. * fixes some of the ISO literal date rendering added in 952383f9ee0 for #5052 to truncate datetime strings for date/time datatypes in the same way that drivers typically do for bound parameters; this was not working fully and wasn't caught by the broken test fixture Fixes: #7212 Change-Id: I981ac6d34d278c18281c144430a528764c241b04
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/_psycopg_common.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/_psycopg_common.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py b/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
index 6b8b3f6d0..e831f2ed9 100644
--- a/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
+++ b/lib/sqlalchemy/dialects/postgresql/_psycopg_common.py
@@ -8,7 +8,6 @@ from .base import _FLOAT_TYPES
from .base import _INT_TYPES
from .base import PGDialect
from .base import PGExecutionContext
-from .base import UUID
from .hstore import HSTORE
from ... import exc
from ... import types as sqltypes
@@ -63,21 +62,6 @@ class _PsycopgHStore(HSTORE):
)
-class _PsycopgUUID(UUID):
- def bind_processor(self, dialect):
- return None
-
- def result_processor(self, dialect, coltype):
- if not self.as_uuid and dialect.use_native_uuid:
-
- def process(value):
- if value is not None:
- value = str(value)
- return value
-
- return process
-
-
class _PsycopgARRAY(PGARRAY):
render_bind_cast = True
@@ -106,7 +90,6 @@ class _PGDialect_common_psycopg(PGDialect):
{
sqltypes.Numeric: _PsycopgNumeric,
HSTORE: _PsycopgHStore,
- UUID: _PsycopgUUID,
sqltypes.ARRAY: _PsycopgARRAY,
},
)
@@ -115,14 +98,12 @@ class _PGDialect_common_psycopg(PGDialect):
self,
client_encoding=None,
use_native_hstore=True,
- use_native_uuid=True,
**kwargs,
):
PGDialect.__init__(self, **kwargs)
if not use_native_hstore:
self._has_native_hstore = False
self.use_native_hstore = use_native_hstore
- self.use_native_uuid = use_native_uuid
self.client_encoding = client_encoding
def create_connect_args(self, url):