SQLAlchemy 2.1.0b1__cp313-cp313-win_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlalchemy/__init__.py +295 -0
- sqlalchemy/connectors/__init__.py +18 -0
- sqlalchemy/connectors/aioodbc.py +161 -0
- sqlalchemy/connectors/asyncio.py +476 -0
- sqlalchemy/connectors/pyodbc.py +250 -0
- sqlalchemy/dialects/__init__.py +62 -0
- sqlalchemy/dialects/_typing.py +30 -0
- sqlalchemy/dialects/mssql/__init__.py +88 -0
- sqlalchemy/dialects/mssql/aioodbc.py +63 -0
- sqlalchemy/dialects/mssql/base.py +4110 -0
- sqlalchemy/dialects/mssql/information_schema.py +285 -0
- sqlalchemy/dialects/mssql/json.py +129 -0
- sqlalchemy/dialects/mssql/provision.py +185 -0
- sqlalchemy/dialects/mssql/pymssql.py +126 -0
- sqlalchemy/dialects/mssql/pyodbc.py +758 -0
- sqlalchemy/dialects/mysql/__init__.py +106 -0
- sqlalchemy/dialects/mysql/_mariadb_shim.py +312 -0
- sqlalchemy/dialects/mysql/aiomysql.py +226 -0
- sqlalchemy/dialects/mysql/asyncmy.py +214 -0
- sqlalchemy/dialects/mysql/base.py +3870 -0
- sqlalchemy/dialects/mysql/cymysql.py +106 -0
- sqlalchemy/dialects/mysql/dml.py +279 -0
- sqlalchemy/dialects/mysql/enumerated.py +277 -0
- sqlalchemy/dialects/mysql/expression.py +146 -0
- sqlalchemy/dialects/mysql/json.py +91 -0
- sqlalchemy/dialects/mysql/mariadb.py +67 -0
- sqlalchemy/dialects/mysql/mariadbconnector.py +330 -0
- sqlalchemy/dialects/mysql/mysqlconnector.py +296 -0
- sqlalchemy/dialects/mysql/mysqldb.py +312 -0
- sqlalchemy/dialects/mysql/provision.py +147 -0
- sqlalchemy/dialects/mysql/pymysql.py +157 -0
- sqlalchemy/dialects/mysql/pyodbc.py +156 -0
- sqlalchemy/dialects/mysql/reflection.py +724 -0
- sqlalchemy/dialects/mysql/reserved_words.py +570 -0
- sqlalchemy/dialects/mysql/types.py +845 -0
- sqlalchemy/dialects/oracle/__init__.py +83 -0
- sqlalchemy/dialects/oracle/base.py +3871 -0
- sqlalchemy/dialects/oracle/cx_oracle.py +1522 -0
- sqlalchemy/dialects/oracle/dictionary.py +507 -0
- sqlalchemy/dialects/oracle/oracledb.py +894 -0
- sqlalchemy/dialects/oracle/provision.py +288 -0
- sqlalchemy/dialects/oracle/types.py +350 -0
- sqlalchemy/dialects/oracle/vector.py +368 -0
- sqlalchemy/dialects/postgresql/__init__.py +171 -0
- sqlalchemy/dialects/postgresql/_psycopg_common.py +193 -0
- sqlalchemy/dialects/postgresql/array.py +534 -0
- sqlalchemy/dialects/postgresql/asyncpg.py +1331 -0
- sqlalchemy/dialects/postgresql/base.py +5729 -0
- sqlalchemy/dialects/postgresql/bitstring.py +327 -0
- sqlalchemy/dialects/postgresql/dml.py +360 -0
- sqlalchemy/dialects/postgresql/ext.py +593 -0
- sqlalchemy/dialects/postgresql/hstore.py +413 -0
- sqlalchemy/dialects/postgresql/json.py +407 -0
- sqlalchemy/dialects/postgresql/named_types.py +521 -0
- sqlalchemy/dialects/postgresql/operators.py +130 -0
- sqlalchemy/dialects/postgresql/pg8000.py +672 -0
- sqlalchemy/dialects/postgresql/pg_catalog.py +344 -0
- sqlalchemy/dialects/postgresql/provision.py +175 -0
- sqlalchemy/dialects/postgresql/psycopg.py +815 -0
- sqlalchemy/dialects/postgresql/psycopg2.py +887 -0
- sqlalchemy/dialects/postgresql/psycopg2cffi.py +61 -0
- sqlalchemy/dialects/postgresql/ranges.py +1002 -0
- sqlalchemy/dialects/postgresql/types.py +388 -0
- sqlalchemy/dialects/sqlite/__init__.py +57 -0
- sqlalchemy/dialects/sqlite/aiosqlite.py +321 -0
- sqlalchemy/dialects/sqlite/base.py +3050 -0
- sqlalchemy/dialects/sqlite/dml.py +279 -0
- sqlalchemy/dialects/sqlite/json.py +89 -0
- sqlalchemy/dialects/sqlite/provision.py +223 -0
- sqlalchemy/dialects/sqlite/pysqlcipher.py +157 -0
- sqlalchemy/dialects/sqlite/pysqlite.py +754 -0
- sqlalchemy/dialects/type_migration_guidelines.txt +145 -0
- sqlalchemy/engine/__init__.py +62 -0
- sqlalchemy/engine/_processors_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/engine/_processors_cy.py +92 -0
- sqlalchemy/engine/_result_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/engine/_result_cy.py +633 -0
- sqlalchemy/engine/_row_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/engine/_row_cy.py +232 -0
- sqlalchemy/engine/_util_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/engine/_util_cy.py +136 -0
- sqlalchemy/engine/base.py +3334 -0
- sqlalchemy/engine/characteristics.py +155 -0
- sqlalchemy/engine/create.py +869 -0
- sqlalchemy/engine/cursor.py +2416 -0
- sqlalchemy/engine/default.py +2393 -0
- sqlalchemy/engine/events.py +965 -0
- sqlalchemy/engine/interfaces.py +3465 -0
- sqlalchemy/engine/mock.py +134 -0
- sqlalchemy/engine/processors.py +82 -0
- sqlalchemy/engine/reflection.py +2100 -0
- sqlalchemy/engine/result.py +1932 -0
- sqlalchemy/engine/row.py +397 -0
- sqlalchemy/engine/strategies.py +16 -0
- sqlalchemy/engine/url.py +922 -0
- sqlalchemy/engine/util.py +156 -0
- sqlalchemy/event/__init__.py +26 -0
- sqlalchemy/event/api.py +220 -0
- sqlalchemy/event/attr.py +674 -0
- sqlalchemy/event/base.py +472 -0
- sqlalchemy/event/legacy.py +258 -0
- sqlalchemy/event/registry.py +390 -0
- sqlalchemy/events.py +17 -0
- sqlalchemy/exc.py +922 -0
- sqlalchemy/ext/__init__.py +11 -0
- sqlalchemy/ext/associationproxy.py +2072 -0
- sqlalchemy/ext/asyncio/__init__.py +29 -0
- sqlalchemy/ext/asyncio/base.py +281 -0
- sqlalchemy/ext/asyncio/engine.py +1475 -0
- sqlalchemy/ext/asyncio/exc.py +21 -0
- sqlalchemy/ext/asyncio/result.py +994 -0
- sqlalchemy/ext/asyncio/scoping.py +1667 -0
- sqlalchemy/ext/asyncio/session.py +1993 -0
- sqlalchemy/ext/automap.py +1701 -0
- sqlalchemy/ext/baked.py +559 -0
- sqlalchemy/ext/compiler.py +600 -0
- sqlalchemy/ext/declarative/__init__.py +65 -0
- sqlalchemy/ext/declarative/extensions.py +560 -0
- sqlalchemy/ext/horizontal_shard.py +481 -0
- sqlalchemy/ext/hybrid.py +1877 -0
- sqlalchemy/ext/indexable.py +364 -0
- sqlalchemy/ext/instrumentation.py +450 -0
- sqlalchemy/ext/mutable.py +1081 -0
- sqlalchemy/ext/orderinglist.py +439 -0
- sqlalchemy/ext/serializer.py +185 -0
- sqlalchemy/future/__init__.py +16 -0
- sqlalchemy/future/engine.py +15 -0
- sqlalchemy/inspection.py +174 -0
- sqlalchemy/log.py +283 -0
- sqlalchemy/orm/__init__.py +175 -0
- sqlalchemy/orm/_orm_constructors.py +2694 -0
- sqlalchemy/orm/_typing.py +179 -0
- sqlalchemy/orm/attributes.py +2868 -0
- sqlalchemy/orm/base.py +970 -0
- sqlalchemy/orm/bulk_persistence.py +2152 -0
- sqlalchemy/orm/clsregistry.py +582 -0
- sqlalchemy/orm/collections.py +1568 -0
- sqlalchemy/orm/context.py +3471 -0
- sqlalchemy/orm/decl_api.py +2257 -0
- sqlalchemy/orm/decl_base.py +2304 -0
- sqlalchemy/orm/dependency.py +1306 -0
- sqlalchemy/orm/descriptor_props.py +1183 -0
- sqlalchemy/orm/dynamic.py +300 -0
- sqlalchemy/orm/evaluator.py +379 -0
- sqlalchemy/orm/events.py +3386 -0
- sqlalchemy/orm/exc.py +237 -0
- sqlalchemy/orm/identity.py +302 -0
- sqlalchemy/orm/instrumentation.py +746 -0
- sqlalchemy/orm/interfaces.py +1589 -0
- sqlalchemy/orm/loading.py +1684 -0
- sqlalchemy/orm/mapped_collection.py +557 -0
- sqlalchemy/orm/mapper.py +4406 -0
- sqlalchemy/orm/path_registry.py +814 -0
- sqlalchemy/orm/persistence.py +1789 -0
- sqlalchemy/orm/properties.py +973 -0
- sqlalchemy/orm/query.py +3521 -0
- sqlalchemy/orm/relationships.py +3570 -0
- sqlalchemy/orm/scoping.py +2220 -0
- sqlalchemy/orm/session.py +5389 -0
- sqlalchemy/orm/state.py +1175 -0
- sqlalchemy/orm/state_changes.py +196 -0
- sqlalchemy/orm/strategies.py +3480 -0
- sqlalchemy/orm/strategy_options.py +2544 -0
- sqlalchemy/orm/sync.py +164 -0
- sqlalchemy/orm/unitofwork.py +798 -0
- sqlalchemy/orm/util.py +2435 -0
- sqlalchemy/orm/writeonly.py +694 -0
- sqlalchemy/pool/__init__.py +41 -0
- sqlalchemy/pool/base.py +1514 -0
- sqlalchemy/pool/events.py +372 -0
- sqlalchemy/pool/impl.py +582 -0
- sqlalchemy/py.typed +0 -0
- sqlalchemy/schema.py +72 -0
- sqlalchemy/sql/__init__.py +153 -0
- sqlalchemy/sql/_dml_constructors.py +132 -0
- sqlalchemy/sql/_elements_constructors.py +2147 -0
- sqlalchemy/sql/_orm_types.py +20 -0
- sqlalchemy/sql/_selectable_constructors.py +773 -0
- sqlalchemy/sql/_typing.py +486 -0
- sqlalchemy/sql/_util_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/sql/_util_cy.py +127 -0
- sqlalchemy/sql/annotation.py +590 -0
- sqlalchemy/sql/base.py +2602 -0
- sqlalchemy/sql/cache_key.py +1066 -0
- sqlalchemy/sql/coercions.py +1373 -0
- sqlalchemy/sql/compiler.py +8259 -0
- sqlalchemy/sql/crud.py +1807 -0
- sqlalchemy/sql/ddl.py +1928 -0
- sqlalchemy/sql/default_comparator.py +654 -0
- sqlalchemy/sql/dml.py +1974 -0
- sqlalchemy/sql/elements.py +6016 -0
- sqlalchemy/sql/events.py +458 -0
- sqlalchemy/sql/expression.py +170 -0
- sqlalchemy/sql/functions.py +2257 -0
- sqlalchemy/sql/lambdas.py +1443 -0
- sqlalchemy/sql/naming.py +209 -0
- sqlalchemy/sql/operators.py +2897 -0
- sqlalchemy/sql/roles.py +332 -0
- sqlalchemy/sql/schema.py +6560 -0
- sqlalchemy/sql/selectable.py +7497 -0
- sqlalchemy/sql/sqltypes.py +4050 -0
- sqlalchemy/sql/traversals.py +1042 -0
- sqlalchemy/sql/type_api.py +2425 -0
- sqlalchemy/sql/util.py +1495 -0
- sqlalchemy/sql/visitors.py +1157 -0
- sqlalchemy/testing/__init__.py +96 -0
- sqlalchemy/testing/assertions.py +1007 -0
- sqlalchemy/testing/assertsql.py +519 -0
- sqlalchemy/testing/asyncio.py +128 -0
- sqlalchemy/testing/config.py +440 -0
- sqlalchemy/testing/engines.py +478 -0
- sqlalchemy/testing/entities.py +117 -0
- sqlalchemy/testing/exclusions.py +476 -0
- sqlalchemy/testing/fixtures/__init__.py +30 -0
- sqlalchemy/testing/fixtures/base.py +366 -0
- sqlalchemy/testing/fixtures/mypy.py +247 -0
- sqlalchemy/testing/fixtures/orm.py +227 -0
- sqlalchemy/testing/fixtures/sql.py +538 -0
- sqlalchemy/testing/pickleable.py +155 -0
- sqlalchemy/testing/plugin/__init__.py +6 -0
- sqlalchemy/testing/plugin/bootstrap.py +51 -0
- sqlalchemy/testing/plugin/plugin_base.py +828 -0
- sqlalchemy/testing/plugin/pytestplugin.py +892 -0
- sqlalchemy/testing/profiling.py +329 -0
- sqlalchemy/testing/provision.py +596 -0
- sqlalchemy/testing/requirements.py +1973 -0
- sqlalchemy/testing/schema.py +198 -0
- sqlalchemy/testing/suite/__init__.py +19 -0
- sqlalchemy/testing/suite/test_cte.py +237 -0
- sqlalchemy/testing/suite/test_ddl.py +420 -0
- sqlalchemy/testing/suite/test_dialect.py +776 -0
- sqlalchemy/testing/suite/test_insert.py +630 -0
- sqlalchemy/testing/suite/test_reflection.py +3557 -0
- sqlalchemy/testing/suite/test_results.py +660 -0
- sqlalchemy/testing/suite/test_rowcount.py +258 -0
- sqlalchemy/testing/suite/test_select.py +2112 -0
- sqlalchemy/testing/suite/test_sequence.py +317 -0
- sqlalchemy/testing/suite/test_table_via_select.py +686 -0
- sqlalchemy/testing/suite/test_types.py +2253 -0
- sqlalchemy/testing/suite/test_unicode_ddl.py +189 -0
- sqlalchemy/testing/suite/test_update_delete.py +139 -0
- sqlalchemy/testing/util.py +535 -0
- sqlalchemy/testing/warnings.py +52 -0
- sqlalchemy/types.py +76 -0
- sqlalchemy/util/__init__.py +157 -0
- sqlalchemy/util/_collections.py +693 -0
- sqlalchemy/util/_collections_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/util/_collections_cy.pxd +8 -0
- sqlalchemy/util/_collections_cy.py +516 -0
- sqlalchemy/util/_has_cython.py +46 -0
- sqlalchemy/util/_immutabledict_cy.cp313-win_arm64.pyd +0 -0
- sqlalchemy/util/_immutabledict_cy.py +240 -0
- sqlalchemy/util/compat.py +287 -0
- sqlalchemy/util/concurrency.py +322 -0
- sqlalchemy/util/cython.py +79 -0
- sqlalchemy/util/deprecations.py +401 -0
- sqlalchemy/util/langhelpers.py +2256 -0
- sqlalchemy/util/preloaded.py +152 -0
- sqlalchemy/util/queue.py +304 -0
- sqlalchemy/util/tool_support.py +201 -0
- sqlalchemy/util/topological.py +120 -0
- sqlalchemy/util/typing.py +711 -0
- sqlalchemy-2.1.0b1.dist-info/METADATA +267 -0
- sqlalchemy-2.1.0b1.dist-info/RECORD +267 -0
- sqlalchemy-2.1.0b1.dist-info/WHEEL +5 -0
- sqlalchemy-2.1.0b1.dist-info/licenses/LICENSE +19 -0
- sqlalchemy-2.1.0b1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# sql/__init__.py
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
|
+
# <see AUTHORS file>
|
|
4
|
+
#
|
|
5
|
+
# This module is part of SQLAlchemy and is released under
|
|
6
|
+
# the MIT License: https://www.opensource.org/licenses/mit-license.php
|
|
7
|
+
from typing import Any
|
|
8
|
+
from typing import TYPE_CHECKING
|
|
9
|
+
|
|
10
|
+
from ._typing import ColumnExpressionArgument as ColumnExpressionArgument
|
|
11
|
+
from ._typing import NotNullable as NotNullable
|
|
12
|
+
from ._typing import Nullable as Nullable
|
|
13
|
+
from .base import Executable as Executable
|
|
14
|
+
from .base import ExecutableStatement as ExecutableStatement
|
|
15
|
+
from .base import SyntaxExtension as SyntaxExtension
|
|
16
|
+
from .compiler import COLLECT_CARTESIAN_PRODUCTS as COLLECT_CARTESIAN_PRODUCTS
|
|
17
|
+
from .compiler import FROM_LINTING as FROM_LINTING
|
|
18
|
+
from .compiler import NO_LINTING as NO_LINTING
|
|
19
|
+
from .compiler import WARN_LINTING as WARN_LINTING
|
|
20
|
+
from .ddl import BaseDDLElement as BaseDDLElement
|
|
21
|
+
from .ddl import CheckFirst as CheckFirst
|
|
22
|
+
from .ddl import DDL as DDL
|
|
23
|
+
from .ddl import DDLElement as DDLElement
|
|
24
|
+
from .ddl import ExecutableDDLElement as ExecutableDDLElement
|
|
25
|
+
from .expression import aggregate_order_by as aggregate_order_by
|
|
26
|
+
from .expression import Alias as Alias
|
|
27
|
+
from .expression import alias as alias
|
|
28
|
+
from .expression import all_ as all_
|
|
29
|
+
from .expression import and_ as and_
|
|
30
|
+
from .expression import any_ as any_
|
|
31
|
+
from .expression import asc as asc
|
|
32
|
+
from .expression import between as between
|
|
33
|
+
from .expression import bindparam as bindparam
|
|
34
|
+
from .expression import case as case
|
|
35
|
+
from .expression import cast as cast
|
|
36
|
+
from .expression import ClauseElement as ClauseElement
|
|
37
|
+
from .expression import collate as collate
|
|
38
|
+
from .expression import column as column
|
|
39
|
+
from .expression import ColumnCollection as ColumnCollection
|
|
40
|
+
from .expression import ColumnElement as ColumnElement
|
|
41
|
+
from .expression import CompoundSelect as CompoundSelect
|
|
42
|
+
from .expression import cte as cte
|
|
43
|
+
from .expression import Delete as Delete
|
|
44
|
+
from .expression import delete as delete
|
|
45
|
+
from .expression import desc as desc
|
|
46
|
+
from .expression import distinct as distinct
|
|
47
|
+
from .expression import except_ as except_
|
|
48
|
+
from .expression import except_all as except_all
|
|
49
|
+
from .expression import exists as exists
|
|
50
|
+
from .expression import extract as extract
|
|
51
|
+
from .expression import false as false
|
|
52
|
+
from .expression import False_ as False_
|
|
53
|
+
from .expression import from_dml_column as from_dml_column
|
|
54
|
+
from .expression import FromClause as FromClause
|
|
55
|
+
from .expression import func as func
|
|
56
|
+
from .expression import funcfilter as funcfilter
|
|
57
|
+
from .expression import Insert as Insert
|
|
58
|
+
from .expression import insert as insert
|
|
59
|
+
from .expression import intersect as intersect
|
|
60
|
+
from .expression import intersect_all as intersect_all
|
|
61
|
+
from .expression import Join as Join
|
|
62
|
+
from .expression import join as join
|
|
63
|
+
from .expression import label as label
|
|
64
|
+
from .expression import LABEL_STYLE_DEFAULT as LABEL_STYLE_DEFAULT
|
|
65
|
+
from .expression import (
|
|
66
|
+
LABEL_STYLE_DISAMBIGUATE_ONLY as LABEL_STYLE_DISAMBIGUATE_ONLY,
|
|
67
|
+
)
|
|
68
|
+
from .expression import LABEL_STYLE_NONE as LABEL_STYLE_NONE
|
|
69
|
+
from .expression import (
|
|
70
|
+
LABEL_STYLE_TABLENAME_PLUS_COL as LABEL_STYLE_TABLENAME_PLUS_COL,
|
|
71
|
+
)
|
|
72
|
+
from .expression import lambda_stmt as lambda_stmt
|
|
73
|
+
from .expression import LambdaElement as LambdaElement
|
|
74
|
+
from .expression import lateral as lateral
|
|
75
|
+
from .expression import literal as literal
|
|
76
|
+
from .expression import literal_column as literal_column
|
|
77
|
+
from .expression import modifier as modifier
|
|
78
|
+
from .expression import not_ as not_
|
|
79
|
+
from .expression import null as null
|
|
80
|
+
from .expression import nulls_first as nulls_first
|
|
81
|
+
from .expression import nulls_last as nulls_last
|
|
82
|
+
from .expression import nullsfirst as nullsfirst
|
|
83
|
+
from .expression import nullslast as nullslast
|
|
84
|
+
from .expression import or_ as or_
|
|
85
|
+
from .expression import outerjoin as outerjoin
|
|
86
|
+
from .expression import outparam as outparam
|
|
87
|
+
from .expression import over as over
|
|
88
|
+
from .expression import quoted_name as quoted_name
|
|
89
|
+
from .expression import Select as Select
|
|
90
|
+
from .expression import select as select
|
|
91
|
+
from .expression import Selectable as Selectable
|
|
92
|
+
from .expression import SelectLabelStyle as SelectLabelStyle
|
|
93
|
+
from .expression import SQLColumnExpression as SQLColumnExpression
|
|
94
|
+
from .expression import StatementLambdaElement as StatementLambdaElement
|
|
95
|
+
from .expression import Subquery as Subquery
|
|
96
|
+
from .expression import table as table
|
|
97
|
+
from .expression import TableClause as TableClause
|
|
98
|
+
from .expression import TableSample as TableSample
|
|
99
|
+
from .expression import tablesample as tablesample
|
|
100
|
+
from .expression import text as text
|
|
101
|
+
from .expression import TextClause as TextClause
|
|
102
|
+
from .expression import true as true
|
|
103
|
+
from .expression import True_ as True_
|
|
104
|
+
from .expression import try_cast as try_cast
|
|
105
|
+
from .expression import TString as TString
|
|
106
|
+
from .expression import tstring as tstring
|
|
107
|
+
from .expression import tuple_ as tuple_
|
|
108
|
+
from .expression import type_coerce as type_coerce
|
|
109
|
+
from .expression import union as union
|
|
110
|
+
from .expression import union_all as union_all
|
|
111
|
+
from .expression import Update as Update
|
|
112
|
+
from .expression import update as update
|
|
113
|
+
from .expression import Values as Values
|
|
114
|
+
from .expression import values as values
|
|
115
|
+
from .expression import within_group as within_group
|
|
116
|
+
from .visitors import ClauseVisitor as ClauseVisitor
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def __go(lcls: Any) -> None:
|
|
120
|
+
from .. import util as _sa_util
|
|
121
|
+
|
|
122
|
+
from . import base
|
|
123
|
+
from . import coercions
|
|
124
|
+
from . import elements
|
|
125
|
+
from . import lambdas
|
|
126
|
+
from . import selectable
|
|
127
|
+
from . import schema
|
|
128
|
+
from . import traversals
|
|
129
|
+
from . import type_api
|
|
130
|
+
|
|
131
|
+
if not TYPE_CHECKING:
|
|
132
|
+
base.coercions = elements.coercions = coercions
|
|
133
|
+
base.elements = elements
|
|
134
|
+
base.type_api = type_api
|
|
135
|
+
coercions.elements = elements
|
|
136
|
+
coercions.lambdas = lambdas
|
|
137
|
+
coercions.schema = schema
|
|
138
|
+
coercions.selectable = selectable
|
|
139
|
+
|
|
140
|
+
from .annotation import _prepare_annotations
|
|
141
|
+
from .annotation import Annotated
|
|
142
|
+
from .elements import AnnotatedColumnElement
|
|
143
|
+
from .elements import ClauseList
|
|
144
|
+
from .selectable import AnnotatedFromClause
|
|
145
|
+
|
|
146
|
+
_prepare_annotations(ColumnElement, AnnotatedColumnElement)
|
|
147
|
+
_prepare_annotations(FromClause, AnnotatedFromClause)
|
|
148
|
+
_prepare_annotations(ClauseList, Annotated)
|
|
149
|
+
|
|
150
|
+
_sa_util.preloaded.import_prefix("sqlalchemy.sql")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
__go(locals())
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# sql/_dml_constructors.py
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
|
+
# <see AUTHORS file>
|
|
4
|
+
#
|
|
5
|
+
# This module is part of SQLAlchemy and is released under
|
|
6
|
+
# the MIT License: https://www.opensource.org/licenses/mit-license.php
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from typing import TYPE_CHECKING
|
|
11
|
+
|
|
12
|
+
from .dml import Delete
|
|
13
|
+
from .dml import Insert
|
|
14
|
+
from .dml import Update
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ._typing import _DMLTableArgument
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def insert(table: _DMLTableArgument) -> Insert:
|
|
21
|
+
"""Construct an :class:`_expression.Insert` object.
|
|
22
|
+
|
|
23
|
+
E.g.::
|
|
24
|
+
|
|
25
|
+
from sqlalchemy import insert
|
|
26
|
+
|
|
27
|
+
stmt = insert(user_table).values(name="username", fullname="Full Username")
|
|
28
|
+
|
|
29
|
+
Similar functionality is available via the
|
|
30
|
+
:meth:`_expression.TableClause.insert` method on
|
|
31
|
+
:class:`_schema.Table`.
|
|
32
|
+
|
|
33
|
+
.. seealso::
|
|
34
|
+
|
|
35
|
+
:ref:`tutorial_core_insert` - in the :ref:`unified_tutorial`
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
:param table: :class:`_expression.TableClause`
|
|
39
|
+
which is the subject of the
|
|
40
|
+
insert.
|
|
41
|
+
|
|
42
|
+
:param values: collection of values to be inserted; see
|
|
43
|
+
:meth:`_expression.Insert.values`
|
|
44
|
+
for a description of allowed formats here.
|
|
45
|
+
Can be omitted entirely; a :class:`_expression.Insert` construct
|
|
46
|
+
will also dynamically render the VALUES clause at execution time
|
|
47
|
+
based on the parameters passed to :meth:`_engine.Connection.execute`.
|
|
48
|
+
|
|
49
|
+
:param inline: if True, no attempt will be made to retrieve the
|
|
50
|
+
SQL-generated default values to be provided within the statement;
|
|
51
|
+
in particular,
|
|
52
|
+
this allows SQL expressions to be rendered 'inline' within the
|
|
53
|
+
statement without the need to pre-execute them beforehand; for
|
|
54
|
+
backends that support "returning", this turns off the "implicit
|
|
55
|
+
returning" feature for the statement.
|
|
56
|
+
|
|
57
|
+
If both :paramref:`_expression.insert.values` and compile-time bind
|
|
58
|
+
parameters are present, the compile-time bind parameters override the
|
|
59
|
+
information specified within :paramref:`_expression.insert.values` on a
|
|
60
|
+
per-key basis.
|
|
61
|
+
|
|
62
|
+
The keys within :paramref:`_expression.Insert.values` can be either
|
|
63
|
+
:class:`~sqlalchemy.schema.Column` objects or their string
|
|
64
|
+
identifiers. Each key may reference one of:
|
|
65
|
+
|
|
66
|
+
* a literal data value (i.e. string, number, etc.);
|
|
67
|
+
* a Column object;
|
|
68
|
+
* a SELECT statement.
|
|
69
|
+
|
|
70
|
+
If a ``SELECT`` statement is specified which references this
|
|
71
|
+
``INSERT`` statement's table, the statement will be correlated
|
|
72
|
+
against the ``INSERT`` statement.
|
|
73
|
+
|
|
74
|
+
.. seealso::
|
|
75
|
+
|
|
76
|
+
:ref:`tutorial_core_insert` - in the :ref:`unified_tutorial`
|
|
77
|
+
|
|
78
|
+
""" # noqa: E501
|
|
79
|
+
return Insert(table)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def update(table: _DMLTableArgument) -> Update:
|
|
83
|
+
r"""Construct an :class:`_expression.Update` object.
|
|
84
|
+
|
|
85
|
+
E.g.::
|
|
86
|
+
|
|
87
|
+
from sqlalchemy import update
|
|
88
|
+
|
|
89
|
+
stmt = (
|
|
90
|
+
update(user_table).where(user_table.c.id == 5).values(name="user #5")
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
Similar functionality is available via the
|
|
94
|
+
:meth:`_expression.TableClause.update` method on
|
|
95
|
+
:class:`_schema.Table`.
|
|
96
|
+
|
|
97
|
+
:param table: A :class:`_schema.Table`
|
|
98
|
+
object representing the database
|
|
99
|
+
table to be updated.
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
.. seealso::
|
|
103
|
+
|
|
104
|
+
:ref:`tutorial_core_update_delete` - in the :ref:`unified_tutorial`
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
""" # noqa: E501
|
|
108
|
+
return Update(table)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def delete(table: _DMLTableArgument) -> Delete:
|
|
112
|
+
r"""Construct :class:`_expression.Delete` object.
|
|
113
|
+
|
|
114
|
+
E.g.::
|
|
115
|
+
|
|
116
|
+
from sqlalchemy import delete
|
|
117
|
+
|
|
118
|
+
stmt = delete(user_table).where(user_table.c.id == 5)
|
|
119
|
+
|
|
120
|
+
Similar functionality is available via the
|
|
121
|
+
:meth:`_expression.TableClause.delete` method on
|
|
122
|
+
:class:`_schema.Table`.
|
|
123
|
+
|
|
124
|
+
:param table: The table to delete rows from.
|
|
125
|
+
|
|
126
|
+
.. seealso::
|
|
127
|
+
|
|
128
|
+
:ref:`tutorial_core_update_delete` - in the :ref:`unified_tutorial`
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
"""
|
|
132
|
+
return Delete(table)
|