diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-17 16:18:55 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-19 23:15:15 -0400 |
commit | 6c3d738757d7be32dc9f99d8e1c6b5c81c596d5f (patch) | |
tree | ae142d45de71d1ebd43df1a38e54e1d3cf1063ec /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | c2fe4a264003933ff895c51f5d07a8456ac86382 (diff) | |
download | sqlalchemy-6c3d738757d7be32dc9f99d8e1c6b5c81c596d5f.tar.gz |
pep 484 for types
strict types type_api.py, including TypeDecorator,
NativeForEmulated, etc.
Change-Id: Ib2eba26de0981324a83733954cb7044a29bbd7db
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index e265cd0f7..a1401ea03 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1712,9 +1712,6 @@ class INTERVAL(sqltypes.NativeForEmulated, sqltypes._AbstractInterval): def python_type(self): return dt.timedelta - def coerce_compared_value(self, op, value): - return self - PGInterval = INTERVAL @@ -2168,7 +2165,7 @@ ischema_names = { class PGCompiler(compiler.SQLCompiler): def render_bind_cast(self, type_, dbapi_type, sqltext): return f"""{sqltext}::{ - self.dialect.type_compiler.process( + self.dialect.type_compiler_instance.process( dbapi_type, identifier_preparer=self.preparer ) }""" @@ -2318,7 +2315,7 @@ class PGCompiler(compiler.SQLCompiler): return "SELECT %s WHERE 1!=1" % ( ", ".join( "CAST(NULL AS %s)" - % self.dialect.type_compiler.process( + % self.dialect.type_compiler_instance.process( INTEGER() if type_._isnull else type_ ) for type_ in element_types or [INTEGER()] @@ -2604,7 +2601,7 @@ class PGDDLCompiler(compiler.DDLCompiler): else: colspec += " SERIAL" else: - colspec += " " + self.dialect.type_compiler.process( + colspec += " " + self.dialect.type_compiler_instance.process( column.type, type_expression=column, identifier_preparer=self.preparer, @@ -3225,7 +3222,7 @@ class PGDialect(default.DefaultDialect): statement_compiler = PGCompiler ddl_compiler = PGDDLCompiler - type_compiler = PGTypeCompiler + type_compiler_cls = PGTypeCompiler preparer = PGIdentifierPreparer execution_ctx_cls = PGExecutionContext inspector = PGInspector |