summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/functions.py
diff options
context:
space:
mode:
authorBryan Forbes <bryan@reigndropsfall.net>2021-04-15 12:35:52 -0500
committerBryan Forbes <bryan@reigndropsfall.net>2021-04-18 13:54:57 -0500
commitadc950945025d436ef97095b4e706700ebae34ff (patch)
treec6d9105d2892e90430ebeeee9847f1379648b02d /lib/sqlalchemy/sql/functions.py
parentb3d764fa768756cd7aef73253ccceac456c76c81 (diff)
downloadsqlalchemy-adc950945025d436ef97095b4e706700ebae34ff.tar.gz
Derive `next_value.type` from `Sequence.data_type` if available
Fixes #6287 Change-Id: I7d428ed86cd72cd910bfff9058a52c7fcb7c64ac
Diffstat (limited to 'lib/sqlalchemy/sql/functions.py')
-rw-r--r--lib/sqlalchemy/sql/functions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py
index d71926a1f..02ed55100 100644
--- a/lib/sqlalchemy/sql/functions.py
+++ b/lib/sqlalchemy/sql/functions.py
@@ -1064,6 +1064,9 @@ class next_value(GenericFunction):
), "next_value() accepts a Sequence object as input."
self._bind = self._get_bind(kw)
self.sequence = seq
+ self.type = sqltypes.to_instance(
+ seq.data_type or getattr(self, "type", None)
+ )
def compare(self, other, **kw):
return (