summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
diff options
context:
space:
mode:
authorCaselIT <cfederico87@gmail.com>2019-11-04 17:11:21 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-11-08 15:40:25 -0500
commit3a0e0531c179e598c345e5be24e350c375ce7e22 (patch)
tree3b0675f216ced73f3d94f825f65ad19d2376e952 /lib/sqlalchemy/schema.py
parent4f5f953b5472790a5ec6c278ec188f9cea035437 (diff)
downloadsqlalchemy-3a0e0531c179e598c345e5be24e350c375ce7e22.tar.gz
Support for generated columns
Added DDL support for "computed columns"; these are DDL column specifications for columns that have a server-computed value, either upon SELECT (known as "virtual") or at the point of which they are INSERTed or UPDATEd (known as "stored"). Support is established for Postgresql, MySQL, Oracle SQL Server and Firebird. Thanks to Federico Caselli for lots of work on this one. ORM round trip tests included. The ORM makes use of existing FetchedValue support and no additional ORM logic is present for the basic feature. It has been observed that Oracle RETURNING does not return the new value of a computed column upon UPDATE; it returns the prior value. As this is very dangerous, a warning is emitted if a computed column is rendered into the RETURNING clause of an UPDATE statement. Fixes: #4894 Closes: #4928 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4928 Pull-request-sha: d39c521d5ac6ebfb4fb5b53846451de79752e64c Change-Id: I2610b2999a5b1b127ed927dcdaeee98b769643ce
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r--lib/sqlalchemy/schema.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index f50acdb1c..6adeded36 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -47,6 +47,7 @@ from .sql.schema import DefaultGenerator # noqa
from .sql.schema import FetchedValue # noqa
from .sql.schema import ForeignKey # noqa
from .sql.schema import ForeignKeyConstraint # noqa
+from .sql.schema import Computed # noqa
from .sql.schema import Index # noqa
from .sql.schema import MetaData # noqa
from .sql.schema import PrimaryKeyConstraint # noqa