diff options
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/__init__.py | 12 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 24 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/ranges.py | 36 |
3 files changed, 72 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/__init__.py b/lib/sqlalchemy/dialects/postgresql/__init__.py index 62195f59e..baafdb181 100644 --- a/lib/sqlalchemy/dialects/postgresql/__init__.py +++ b/lib/sqlalchemy/dialects/postgresql/__init__.py @@ -47,11 +47,17 @@ from .named_types import DropDomainType from .named_types import DropEnumType from .named_types import ENUM from .named_types import NamedType +from .ranges import DATEMULTIRANGE from .ranges import DATERANGE +from .ranges import INT4MULTIRANGE from .ranges import INT4RANGE +from .ranges import INT8MULTIRANGE from .ranges import INT8RANGE +from .ranges import NUMMULTIRANGE from .ranges import NUMRANGE +from .ranges import TSMULTIRANGE from .ranges import TSRANGE +from .ranges import TSTZMULTIRANGE from .ranges import TSTZRANGE from .types import BIT from .types import BYTEA @@ -110,9 +116,15 @@ __all__ = ( "INT8RANGE", "NUMRANGE", "DATERANGE", + "INT4MULTIRANGE", + "INT8MULTIRANGE", + "NUMMULTIRANGE", + "DATEMULTIRANGE", "TSVECTOR", "TSRANGE", "TSTZRANGE", + "TSMULTIRANGE", + "TSTZMULTIRANGE", "JSON", "JSONB", "Any", diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 8b89cdee2..efb4dd547 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1656,6 +1656,12 @@ ischema_names = { "daterange": _ranges.DATERANGE, "tsrange": _ranges.TSRANGE, "tstzrange": _ranges.TSTZRANGE, + "int4multirange": _ranges.INT4MULTIRANGE, + "int8multirange": _ranges.INT8MULTIRANGE, + "nummultirange": _ranges.NUMMULTIRANGE, + "datemultirange": _ranges.DATEMULTIRANGE, + "tsmultirange": _ranges.TSMULTIRANGE, + "tstzmultirange": _ranges.TSTZMULTIRANGE, "integer": INTEGER, "bigint": BIGINT, "smallint": SMALLINT, @@ -2500,6 +2506,24 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): def visit_JSONB(self, type_, **kw): return "JSONB" + def visit_INT4MULTIRANGE(self, type_, **kw): + return "INT4MULTIRANGE" + + def visit_INT8MULTIRANGE(self, type_, **kw): + return "INT8MULTIRANGE" + + def visit_NUMMULTIRANGE(self, type_, **kw): + return "NUMMULTIRANGE" + + def visit_DATEMULTIRANGE(self, type_, **kw): + return "DATEMULTIRANGE" + + def visit_TSMULTIRANGE(self, type_, **kw): + return "TSMULTIRANGE" + + def visit_TSTZMULTIRANGE(self, type_, **kw): + return "TSTZMULTIRANGE" + def visit_INT4RANGE(self, type_, **kw): return "INT4RANGE" diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py index 81431ad59..4f010abf1 100644 --- a/lib/sqlalchemy/dialects/postgresql/ranges.py +++ b/lib/sqlalchemy/dialects/postgresql/ranges.py @@ -138,3 +138,39 @@ class TSTZRANGE(RangeOperators, sqltypes.TypeEngine): """Represent the PostgreSQL TSTZRANGE type.""" __visit_name__ = "TSTZRANGE" + + +class INT4MULTIRANGE(RangeOperators, sqltypes.TypeEngine): + """Represent the PostgreSQL INT4MULTIRANGE type.""" + + __visit_name__ = "INT4MULTIRANGE" + + +class INT8MULTIRANGE(RangeOperators, sqltypes.TypeEngine): + """Represent the PostgreSQL INT8MULTIRANGE type.""" + + __visit_name__ = "INT8MULTIRANGE" + + +class NUMMULTIRANGE(RangeOperators, sqltypes.TypeEngine): + """Represent the PostgreSQL NUMMULTIRANGE type.""" + + __visit_name__ = "NUMMULTIRANGE" + + +class DATEMULTIRANGE(RangeOperators, sqltypes.TypeEngine): + """Represent the PostgreSQL DATEMULTIRANGE type.""" + + __visit_name__ = "DATEMULTIRANGE" + + +class TSMULTIRANGE(RangeOperators, sqltypes.TypeEngine): + """Represent the PostgreSQL TSRANGE type.""" + + __visit_name__ = "TSMULTIRANGE" + + +class TSTZMULTIRANGE(RangeOperators, sqltypes.TypeEngine): + """Represent the PostgreSQL TSTZRANGE type.""" + + __visit_name__ = "TSTZMULTIRANGE" |