diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2022-06-01 16:13:36 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-06-01 16:13:36 +0000 |
| commit | 7b6fb299bb6b47dfeb22a5650b95af7fa0b35ec2 (patch) | |
| tree | 84d683a496c9951838adb4efc09687f7c55b05af /lib/sqlalchemy/dialects/postgresql/asyncpg.py | |
| parent | 79dbe94bb4ccd75888d57f388195a3ba4fa6117e (diff) | |
| parent | 349a7c5e0e2aeeac98fad789b0043a4bdfeed837 (diff) | |
| download | sqlalchemy-7b6fb299bb6b47dfeb22a5650b95af7fa0b35ec2.tar.gz | |
Merge "add backend agnostic UUID datatype" into main
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/asyncpg.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/asyncpg.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py index d320c323c..1ec787e1f 100644 --- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py +++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py @@ -138,7 +138,6 @@ from .base import PGDialect from .base import PGExecutionContext from .base import PGIdentifierPreparer from .base import REGCLASS -from .base import UUID from ... import exc from ... import pool from ... import util @@ -150,12 +149,6 @@ from ...util.concurrency import await_fallback from ...util.concurrency import await_only -try: - from uuid import UUID as _python_UUID # noqa -except ImportError: - _python_UUID = None - - class AsyncpgString(sqltypes.String): render_bind_cast = True @@ -237,30 +230,6 @@ class AsyncpgJSONPathType(json.JSONPathType): return process -class AsyncpgUUID(UUID): - render_bind_cast = True - - def bind_processor(self, dialect): - if not self.as_uuid and dialect.use_native_uuid: - - def process(value): - if value is not None: - value = _python_UUID(value) - return value - - return process - - 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 AsyncpgNumeric(sqltypes.Numeric): render_bind_cast = True @@ -831,8 +800,6 @@ class PGDialect_asyncpg(PGDialect): statement_compiler = PGCompiler_asyncpg preparer = PGIdentifierPreparer_asyncpg - use_native_uuid = True - colspecs = util.update_copy( PGDialect.colspecs, { @@ -842,7 +809,6 @@ class PGDialect_asyncpg(PGDialect): sqltypes.DateTime: AsyncpgDateTime, sqltypes.Interval: AsyncPgInterval, INTERVAL: AsyncPgInterval, - UUID: AsyncpgUUID, sqltypes.Boolean: AsyncpgBoolean, sqltypes.Integer: AsyncpgInteger, sqltypes.BigInteger: AsyncpgBigInteger, |
