SQLAlchemy 2.0.45__py3-none-any.whl → 2.0.47__py3-none-any.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 +2 -2
- sqlalchemy/connectors/__init__.py +1 -1
- sqlalchemy/connectors/aioodbc.py +1 -1
- sqlalchemy/connectors/asyncio.py +2 -2
- sqlalchemy/connectors/pyodbc.py +1 -1
- sqlalchemy/cyextension/__init__.py +1 -1
- sqlalchemy/dialects/__init__.py +1 -1
- sqlalchemy/dialects/_typing.py +1 -1
- sqlalchemy/dialects/mssql/__init__.py +1 -1
- sqlalchemy/dialects/mssql/aioodbc.py +1 -1
- sqlalchemy/dialects/mssql/base.py +11 -7
- sqlalchemy/dialects/mssql/information_schema.py +1 -1
- sqlalchemy/dialects/mssql/json.py +1 -1
- sqlalchemy/dialects/mssql/provision.py +23 -6
- sqlalchemy/dialects/mssql/pymssql.py +1 -1
- sqlalchemy/dialects/mssql/pyodbc.py +1 -1
- sqlalchemy/dialects/mysql/__init__.py +1 -1
- sqlalchemy/dialects/mysql/aiomysql.py +1 -1
- sqlalchemy/dialects/mysql/asyncmy.py +1 -1
- sqlalchemy/dialects/mysql/base.py +24 -8
- sqlalchemy/dialects/mysql/cymysql.py +1 -1
- sqlalchemy/dialects/mysql/dml.py +1 -1
- sqlalchemy/dialects/mysql/enumerated.py +1 -1
- sqlalchemy/dialects/mysql/expression.py +1 -1
- sqlalchemy/dialects/mysql/json.py +1 -1
- sqlalchemy/dialects/mysql/mariadb.py +2 -3
- sqlalchemy/dialects/mysql/mariadbconnector.py +1 -1
- sqlalchemy/dialects/mysql/mysqlconnector.py +1 -1
- sqlalchemy/dialects/mysql/mysqldb.py +1 -1
- sqlalchemy/dialects/mysql/provision.py +8 -2
- sqlalchemy/dialects/mysql/pymysql.py +1 -1
- sqlalchemy/dialects/mysql/pyodbc.py +1 -1
- sqlalchemy/dialects/mysql/reflection.py +1 -1
- sqlalchemy/dialects/mysql/reserved_words.py +1 -1
- sqlalchemy/dialects/mysql/types.py +1 -1
- sqlalchemy/dialects/oracle/__init__.py +1 -1
- sqlalchemy/dialects/oracle/base.py +2 -2
- sqlalchemy/dialects/oracle/cx_oracle.py +1 -1
- sqlalchemy/dialects/oracle/dictionary.py +1 -1
- sqlalchemy/dialects/oracle/oracledb.py +2 -2
- sqlalchemy/dialects/oracle/provision.py +2 -2
- sqlalchemy/dialects/oracle/types.py +1 -1
- sqlalchemy/dialects/oracle/vector.py +4 -4
- sqlalchemy/dialects/postgresql/__init__.py +1 -1
- sqlalchemy/dialects/postgresql/_psycopg_common.py +1 -1
- sqlalchemy/dialects/postgresql/array.py +1 -1
- sqlalchemy/dialects/postgresql/asyncpg.py +2 -2
- sqlalchemy/dialects/postgresql/base.py +74 -24
- sqlalchemy/dialects/postgresql/dml.py +1 -1
- sqlalchemy/dialects/postgresql/ext.py +1 -1
- sqlalchemy/dialects/postgresql/hstore.py +1 -1
- sqlalchemy/dialects/postgresql/json.py +10 -1
- sqlalchemy/dialects/postgresql/named_types.py +1 -1
- sqlalchemy/dialects/postgresql/operators.py +1 -1
- sqlalchemy/dialects/postgresql/pg8000.py +1 -1
- sqlalchemy/dialects/postgresql/pg_catalog.py +1 -1
- sqlalchemy/dialects/postgresql/provision.py +11 -3
- sqlalchemy/dialects/postgresql/psycopg.py +1 -1
- sqlalchemy/dialects/postgresql/psycopg2.py +1 -1
- sqlalchemy/dialects/postgresql/psycopg2cffi.py +1 -1
- sqlalchemy/dialects/postgresql/ranges.py +1 -1
- sqlalchemy/dialects/postgresql/types.py +1 -1
- sqlalchemy/dialects/sqlite/__init__.py +1 -1
- sqlalchemy/dialects/sqlite/aiosqlite.py +40 -4
- sqlalchemy/dialects/sqlite/base.py +19 -8
- sqlalchemy/dialects/sqlite/dml.py +1 -1
- sqlalchemy/dialects/sqlite/json.py +1 -1
- sqlalchemy/dialects/sqlite/provision.py +8 -2
- sqlalchemy/dialects/sqlite/pysqlcipher.py +1 -1
- sqlalchemy/dialects/sqlite/pysqlite.py +2 -2
- sqlalchemy/engine/__init__.py +1 -1
- sqlalchemy/engine/_py_processors.py +1 -1
- sqlalchemy/engine/_py_row.py +1 -1
- sqlalchemy/engine/_py_util.py +1 -1
- sqlalchemy/engine/base.py +9 -1
- sqlalchemy/engine/characteristics.py +1 -1
- sqlalchemy/engine/create.py +1 -1
- sqlalchemy/engine/cursor.py +2 -2
- sqlalchemy/engine/default.py +1 -1
- sqlalchemy/engine/events.py +1 -1
- sqlalchemy/engine/interfaces.py +1 -1
- sqlalchemy/engine/mock.py +1 -1
- sqlalchemy/engine/processors.py +1 -1
- sqlalchemy/engine/reflection.py +1 -1
- sqlalchemy/engine/result.py +14 -2
- sqlalchemy/engine/row.py +1 -1
- sqlalchemy/engine/strategies.py +1 -1
- sqlalchemy/engine/url.py +1 -1
- sqlalchemy/engine/util.py +1 -1
- sqlalchemy/event/__init__.py +1 -1
- sqlalchemy/event/api.py +1 -1
- sqlalchemy/event/attr.py +1 -1
- sqlalchemy/event/base.py +1 -1
- sqlalchemy/event/legacy.py +1 -1
- sqlalchemy/event/registry.py +1 -1
- sqlalchemy/events.py +1 -1
- sqlalchemy/exc.py +1 -1
- sqlalchemy/ext/__init__.py +1 -1
- sqlalchemy/ext/associationproxy.py +3 -3
- sqlalchemy/ext/asyncio/__init__.py +1 -1
- sqlalchemy/ext/asyncio/base.py +2 -2
- sqlalchemy/ext/asyncio/engine.py +2 -2
- sqlalchemy/ext/asyncio/exc.py +1 -1
- sqlalchemy/ext/asyncio/result.py +1 -1
- sqlalchemy/ext/asyncio/scoping.py +1 -1
- sqlalchemy/ext/asyncio/session.py +1 -1
- sqlalchemy/ext/automap.py +1 -1
- sqlalchemy/ext/baked.py +1 -1
- sqlalchemy/ext/compiler.py +1 -1
- sqlalchemy/ext/declarative/__init__.py +1 -1
- sqlalchemy/ext/declarative/extensions.py +1 -1
- sqlalchemy/ext/horizontal_shard.py +2 -2
- sqlalchemy/ext/hybrid.py +4 -4
- sqlalchemy/ext/indexable.py +1 -1
- sqlalchemy/ext/instrumentation.py +1 -1
- sqlalchemy/ext/mutable.py +1 -1
- sqlalchemy/ext/mypy/__init__.py +1 -1
- sqlalchemy/ext/mypy/apply.py +1 -1
- sqlalchemy/ext/mypy/decl_class.py +1 -1
- sqlalchemy/ext/mypy/infer.py +1 -1
- sqlalchemy/ext/mypy/names.py +1 -1
- sqlalchemy/ext/mypy/plugin.py +1 -1
- sqlalchemy/ext/mypy/util.py +1 -1
- sqlalchemy/ext/orderinglist.py +1 -1
- sqlalchemy/ext/serializer.py +1 -1
- sqlalchemy/future/__init__.py +1 -1
- sqlalchemy/future/engine.py +1 -1
- sqlalchemy/inspection.py +1 -1
- sqlalchemy/log.py +1 -1
- sqlalchemy/orm/__init__.py +1 -1
- sqlalchemy/orm/_orm_constructors.py +2 -2
- sqlalchemy/orm/_typing.py +1 -1
- sqlalchemy/orm/attributes.py +1 -1
- sqlalchemy/orm/base.py +1 -1
- sqlalchemy/orm/bulk_persistence.py +3 -3
- sqlalchemy/orm/clsregistry.py +1 -1
- sqlalchemy/orm/collections.py +1 -1
- sqlalchemy/orm/context.py +1 -1
- sqlalchemy/orm/decl_api.py +3 -3
- sqlalchemy/orm/decl_base.py +1 -1
- sqlalchemy/orm/dependency.py +1 -1
- sqlalchemy/orm/descriptor_props.py +2 -2
- sqlalchemy/orm/dynamic.py +1 -1
- sqlalchemy/orm/evaluator.py +1 -1
- sqlalchemy/orm/events.py +1 -1
- sqlalchemy/orm/exc.py +1 -1
- sqlalchemy/orm/identity.py +1 -1
- sqlalchemy/orm/instrumentation.py +1 -1
- sqlalchemy/orm/interfaces.py +2 -2
- sqlalchemy/orm/loading.py +1 -1
- sqlalchemy/orm/mapped_collection.py +1 -1
- sqlalchemy/orm/mapper.py +2 -2
- sqlalchemy/orm/path_registry.py +1 -1
- sqlalchemy/orm/persistence.py +1 -1
- sqlalchemy/orm/properties.py +1 -1
- sqlalchemy/orm/query.py +3 -3
- sqlalchemy/orm/relationships.py +1 -1
- sqlalchemy/orm/scoping.py +2 -2
- sqlalchemy/orm/session.py +4 -4
- sqlalchemy/orm/state.py +1 -1
- sqlalchemy/orm/state_changes.py +3 -3
- sqlalchemy/orm/strategies.py +2 -2
- sqlalchemy/orm/strategy_options.py +2 -2
- sqlalchemy/orm/sync.py +1 -1
- sqlalchemy/orm/unitofwork.py +1 -1
- sqlalchemy/orm/util.py +1 -1
- sqlalchemy/orm/writeonly.py +1 -1
- sqlalchemy/pool/__init__.py +1 -1
- sqlalchemy/pool/base.py +10 -2
- sqlalchemy/pool/events.py +16 -13
- sqlalchemy/pool/impl.py +1 -1
- sqlalchemy/schema.py +1 -1
- sqlalchemy/sql/__init__.py +1 -1
- sqlalchemy/sql/_dml_constructors.py +1 -1
- sqlalchemy/sql/_elements_constructors.py +1 -1
- sqlalchemy/sql/_orm_types.py +1 -1
- sqlalchemy/sql/_py_util.py +1 -1
- sqlalchemy/sql/_selectable_constructors.py +1 -1
- sqlalchemy/sql/_typing.py +2 -1
- sqlalchemy/sql/annotation.py +1 -1
- sqlalchemy/sql/base.py +75 -1
- sqlalchemy/sql/cache_key.py +1 -1
- sqlalchemy/sql/coercions.py +1 -1
- sqlalchemy/sql/compiler.py +54 -7
- sqlalchemy/sql/crud.py +12 -4
- sqlalchemy/sql/ddl.py +1 -1
- sqlalchemy/sql/default_comparator.py +1 -1
- sqlalchemy/sql/dml.py +2 -2
- sqlalchemy/sql/elements.py +3 -3
- sqlalchemy/sql/events.py +1 -1
- sqlalchemy/sql/expression.py +1 -1
- sqlalchemy/sql/functions.py +26 -7
- sqlalchemy/sql/lambdas.py +2 -2
- sqlalchemy/sql/naming.py +1 -1
- sqlalchemy/sql/operators.py +1 -1
- sqlalchemy/sql/roles.py +1 -1
- sqlalchemy/sql/schema.py +2 -2
- sqlalchemy/sql/selectable.py +2 -2
- sqlalchemy/sql/sqltypes.py +2 -2
- sqlalchemy/sql/traversals.py +1 -1
- sqlalchemy/sql/type_api.py +1 -1
- sqlalchemy/sql/util.py +1 -1
- sqlalchemy/sql/visitors.py +2 -2
- sqlalchemy/testing/__init__.py +1 -1
- sqlalchemy/testing/assertions.py +1 -1
- sqlalchemy/testing/assertsql.py +1 -1
- sqlalchemy/testing/asyncio.py +1 -1
- sqlalchemy/testing/config.py +1 -1
- sqlalchemy/testing/engines.py +9 -4
- sqlalchemy/testing/entities.py +1 -1
- sqlalchemy/testing/exclusions.py +1 -1
- sqlalchemy/testing/fixtures/__init__.py +1 -1
- sqlalchemy/testing/fixtures/base.py +19 -1
- sqlalchemy/testing/fixtures/mypy.py +1 -1
- sqlalchemy/testing/fixtures/orm.py +1 -1
- sqlalchemy/testing/fixtures/sql.py +1 -1
- sqlalchemy/testing/pickleable.py +1 -1
- sqlalchemy/testing/plugin/__init__.py +1 -1
- sqlalchemy/testing/plugin/bootstrap.py +1 -1
- sqlalchemy/testing/plugin/plugin_base.py +2 -2
- sqlalchemy/testing/plugin/pytestplugin.py +1 -1
- sqlalchemy/testing/profiling.py +3 -1
- sqlalchemy/testing/provision.py +8 -2
- sqlalchemy/testing/requirements.py +6 -1
- sqlalchemy/testing/schema.py +1 -1
- sqlalchemy/testing/suite/__init__.py +1 -1
- sqlalchemy/testing/suite/test_cte.py +1 -1
- sqlalchemy/testing/suite/test_ddl.py +1 -1
- sqlalchemy/testing/suite/test_deprecations.py +1 -1
- sqlalchemy/testing/suite/test_dialect.py +1 -1
- sqlalchemy/testing/suite/test_insert.py +1 -1
- sqlalchemy/testing/suite/test_reflection.py +1 -1
- sqlalchemy/testing/suite/test_results.py +1 -1
- sqlalchemy/testing/suite/test_rowcount.py +1 -1
- sqlalchemy/testing/suite/test_select.py +1 -1
- sqlalchemy/testing/suite/test_sequence.py +1 -1
- sqlalchemy/testing/suite/test_types.py +1 -1
- sqlalchemy/testing/suite/test_unicode_ddl.py +1 -1
- sqlalchemy/testing/suite/test_update_delete.py +1 -1
- sqlalchemy/testing/util.py +1 -1
- sqlalchemy/testing/warnings.py +1 -1
- sqlalchemy/types.py +1 -1
- sqlalchemy/util/__init__.py +2 -2
- sqlalchemy/util/_collections.py +2 -7
- sqlalchemy/util/_concurrency_py3k.py +1 -1
- sqlalchemy/util/_has_cy.py +1 -1
- sqlalchemy/util/_py_collections.py +1 -1
- sqlalchemy/util/compat.py +108 -3
- sqlalchemy/util/concurrency.py +1 -1
- sqlalchemy/util/deprecations.py +1 -1
- sqlalchemy/util/langhelpers.py +1 -104
- sqlalchemy/util/preloaded.py +1 -1
- sqlalchemy/util/queue.py +1 -1
- sqlalchemy/util/tool_support.py +1 -1
- sqlalchemy/util/topological.py +1 -1
- sqlalchemy/util/typing.py +1 -1
- {sqlalchemy-2.0.45.dist-info → sqlalchemy-2.0.47.dist-info}/METADATA +1 -1
- sqlalchemy-2.0.47.dist-info/RECORD +269 -0
- {sqlalchemy-2.0.45.dist-info → sqlalchemy-2.0.47.dist-info}/WHEEL +1 -1
- {sqlalchemy-2.0.45.dist-info → sqlalchemy-2.0.47.dist-info}/licenses/LICENSE +1 -1
- sqlalchemy-2.0.45.dist-info/RECORD +0 -269
- {sqlalchemy-2.0.45.dist-info → sqlalchemy-2.0.47.dist-info}/top_level.txt +0 -0
sqlalchemy/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# __init__.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -269,7 +269,7 @@ from .types import Uuid as Uuid
|
|
|
269
269
|
from .types import VARBINARY as VARBINARY
|
|
270
270
|
from .types import VARCHAR as VARCHAR
|
|
271
271
|
|
|
272
|
-
__version__ = "2.0.
|
|
272
|
+
__version__ = "2.0.47"
|
|
273
273
|
|
|
274
274
|
|
|
275
275
|
def __go(lcls: Any) -> None:
|
sqlalchemy/connectors/aioodbc.py
CHANGED
sqlalchemy/connectors/asyncio.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# connectors/asyncio.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -270,7 +270,7 @@ class AsyncAdapt_dbapi_cursor:
|
|
|
270
270
|
)
|
|
271
271
|
|
|
272
272
|
def setinputsizes(self, *inputsizes: Any) -> None:
|
|
273
|
-
# NOTE: this is
|
|
273
|
+
# NOTE: this is overridden in aioodbc due to
|
|
274
274
|
# see https://github.com/aio-libs/aioodbc/issues/451
|
|
275
275
|
# right now
|
|
276
276
|
|
sqlalchemy/connectors/pyodbc.py
CHANGED
sqlalchemy/dialects/__init__.py
CHANGED
sqlalchemy/dialects/_typing.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/mssql/base.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -984,6 +984,7 @@ import codecs
|
|
|
984
984
|
import datetime
|
|
985
985
|
import operator
|
|
986
986
|
import re
|
|
987
|
+
from typing import Any
|
|
987
988
|
from typing import overload
|
|
988
989
|
from typing import TYPE_CHECKING
|
|
989
990
|
from uuid import UUID as _python_UUID
|
|
@@ -1034,6 +1035,7 @@ from ...util import update_wrapper
|
|
|
1034
1035
|
from ...util.typing import Literal
|
|
1035
1036
|
|
|
1036
1037
|
if TYPE_CHECKING:
|
|
1038
|
+
from ...sql.ddl import DropIndex
|
|
1037
1039
|
from ...sql.dml import DMLState
|
|
1038
1040
|
from ...sql.selectable import TableClause
|
|
1039
1041
|
|
|
@@ -2064,8 +2066,8 @@ class MSSQLCompiler(compiler.SQLCompiler):
|
|
|
2064
2066
|
def visit_aggregate_strings_func(self, fn, **kw):
|
|
2065
2067
|
expr = fn.clauses.clauses[0]._compiler_dispatch(self, **kw)
|
|
2066
2068
|
kw["literal_execute"] = True
|
|
2067
|
-
|
|
2068
|
-
return f"string_agg({expr}, {
|
|
2069
|
+
delimiter = fn.clauses.clauses[1]._compiler_dispatch(self, **kw)
|
|
2070
|
+
return f"string_agg({expr}, {delimiter})"
|
|
2069
2071
|
|
|
2070
2072
|
def visit_concat_op_expression_clauselist(
|
|
2071
2073
|
self, clauselist, operator, **kw
|
|
@@ -2700,11 +2702,13 @@ class MSDDLCompiler(compiler.DDLCompiler):
|
|
|
2700
2702
|
|
|
2701
2703
|
return text
|
|
2702
2704
|
|
|
2703
|
-
def visit_drop_index(self, drop, **kw):
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
self.preparer.format_table(drop.element.table),
|
|
2705
|
+
def visit_drop_index(self, drop: DropIndex, **kw: Any) -> str:
|
|
2706
|
+
index_name = self._prepared_index_name(
|
|
2707
|
+
drop.element, include_schema=False
|
|
2707
2708
|
)
|
|
2709
|
+
table_name = self.preparer.format_table(drop.element.table)
|
|
2710
|
+
if_exists = " IF EXISTS" if drop.if_exists else ""
|
|
2711
|
+
return f"\nDROP INDEX{if_exists} {index_name} ON {table_name}"
|
|
2708
2712
|
|
|
2709
2713
|
def visit_primary_key_constraint(self, constraint, **kw):
|
|
2710
2714
|
if len(constraint) == 0:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/mssql/provision.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -137,11 +137,28 @@ def drop_all_schema_objects_pre_tables(cfg, eng):
|
|
|
137
137
|
with eng.connect().execution_options(isolation_level="AUTOCOMMIT") as conn:
|
|
138
138
|
inspector = inspect(conn)
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
|
|
140
|
+
# Drop all full-text indexes before dropping catalogs
|
|
141
|
+
fulltext_indexes = conn.exec_driver_sql(
|
|
142
|
+
"SELECT OBJECT_SCHEMA_NAME(object_id) AS schema_name, "
|
|
143
|
+
"OBJECT_NAME(object_id) AS table_name "
|
|
144
|
+
"FROM sys.fulltext_indexes"
|
|
145
|
+
).fetchall()
|
|
146
|
+
|
|
147
|
+
for schema_name, table_name in fulltext_indexes:
|
|
148
|
+
if schema_name:
|
|
149
|
+
qualified_name = f"[{schema_name}].[{table_name}]"
|
|
150
|
+
else:
|
|
151
|
+
qualified_name = f"[{table_name}]"
|
|
152
|
+
conn.exec_driver_sql(f"DROP FULLTEXT INDEX ON {qualified_name}")
|
|
153
|
+
|
|
154
|
+
# Now drop all full-text catalogs
|
|
155
|
+
fulltext_catalogs = conn.exec_driver_sql(
|
|
156
|
+
"SELECT name FROM sys.fulltext_catalogs"
|
|
157
|
+
).fetchall()
|
|
158
|
+
|
|
159
|
+
for (catalog_name,) in fulltext_catalogs:
|
|
160
|
+
conn.exec_driver_sql(f"DROP FULLTEXT CATALOG [{catalog_name}]")
|
|
161
|
+
|
|
145
162
|
for schema in (None, "dbo", cfg.test_schema, cfg.test_schema_2):
|
|
146
163
|
for tname in inspector.get_table_names(schema=schema):
|
|
147
164
|
tb = Table(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/mysql/base.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -1182,6 +1182,7 @@ if TYPE_CHECKING:
|
|
|
1182
1182
|
from ...sql.functions import random
|
|
1183
1183
|
from ...sql.functions import rollup
|
|
1184
1184
|
from ...sql.functions import sysdate
|
|
1185
|
+
from ...sql.schema import IdentityOptions
|
|
1185
1186
|
from ...sql.schema import Sequence as Sequence_SchemaItem
|
|
1186
1187
|
from ...sql.type_api import TypeEngine
|
|
1187
1188
|
from ...sql.visitors import ExternallyTraversible
|
|
@@ -1358,10 +1359,10 @@ class MySQLCompiler(compiler.SQLCompiler):
|
|
|
1358
1359
|
def visit_aggregate_strings_func(
|
|
1359
1360
|
self, fn: aggregate_strings, **kw: Any
|
|
1360
1361
|
) -> str:
|
|
1361
|
-
expr,
|
|
1362
|
+
expr, delimiter = (
|
|
1362
1363
|
elem._compiler_dispatch(self, **kw) for elem in fn.clauses
|
|
1363
1364
|
)
|
|
1364
|
-
return f"group_concat({expr} SEPARATOR {
|
|
1365
|
+
return f"group_concat({expr} SEPARATOR {delimiter})"
|
|
1365
1366
|
|
|
1366
1367
|
def visit_sequence(self, sequence: sa_schema.Sequence, **kw: Any) -> str:
|
|
1367
1368
|
return "nextval(%s)" % self.preparer.format_sequence(sequence)
|
|
@@ -2199,7 +2200,7 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
|
|
|
2199
2200
|
if index.unique:
|
|
2200
2201
|
text += "UNIQUE "
|
|
2201
2202
|
|
|
2202
|
-
index_prefix = index.
|
|
2203
|
+
index_prefix = index.get_dialect_option(self.dialect, "prefix")
|
|
2203
2204
|
if index_prefix:
|
|
2204
2205
|
text += index_prefix + " "
|
|
2205
2206
|
|
|
@@ -2208,7 +2209,7 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
|
|
|
2208
2209
|
text += "IF NOT EXISTS "
|
|
2209
2210
|
text += "%s ON %s " % (name, table)
|
|
2210
2211
|
|
|
2211
|
-
length = index.
|
|
2212
|
+
length = index.get_dialect_option(self.dialect, "length")
|
|
2212
2213
|
if length is not None:
|
|
2213
2214
|
if isinstance(length, dict):
|
|
2214
2215
|
# length value can be a (column_name --> integer value)
|
|
@@ -2236,11 +2237,15 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
|
|
|
2236
2237
|
columns_str = ", ".join(columns)
|
|
2237
2238
|
text += "(%s)" % columns_str
|
|
2238
2239
|
|
|
2239
|
-
parser = index.
|
|
2240
|
+
parser = index.get_dialect_option(
|
|
2241
|
+
self.dialect, "with_parser", deprecated_fallback="mysql"
|
|
2242
|
+
)
|
|
2240
2243
|
if parser is not None:
|
|
2241
2244
|
text += " WITH PARSER %s" % (parser,)
|
|
2242
2245
|
|
|
2243
|
-
using = index.
|
|
2246
|
+
using = index.get_dialect_option(
|
|
2247
|
+
self.dialect, "using", deprecated_fallback="mysql"
|
|
2248
|
+
)
|
|
2244
2249
|
if using is not None:
|
|
2245
2250
|
text += " USING %s" % (preparer.quote(using))
|
|
2246
2251
|
|
|
@@ -2250,7 +2255,9 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
|
|
|
2250
2255
|
self, constraint: sa_schema.PrimaryKeyConstraint, **kw: Any
|
|
2251
2256
|
) -> str:
|
|
2252
2257
|
text = super().visit_primary_key_constraint(constraint)
|
|
2253
|
-
using = constraint.
|
|
2258
|
+
using = constraint.get_dialect_option(
|
|
2259
|
+
self.dialect, "using", deprecated_fallback="mysql"
|
|
2260
|
+
)
|
|
2254
2261
|
if using:
|
|
2255
2262
|
text += " USING %s" % (self.preparer.quote(using))
|
|
2256
2263
|
return text
|
|
@@ -2330,6 +2337,15 @@ class MySQLDDLCompiler(compiler.DDLCompiler):
|
|
|
2330
2337
|
self.get_column_specification(create.element),
|
|
2331
2338
|
)
|
|
2332
2339
|
|
|
2340
|
+
def get_identity_options(self, identity_options: IdentityOptions) -> str:
|
|
2341
|
+
"""mariadb-specific sequence option; this will move to a
|
|
2342
|
+
mariadb-specific module in 2.1
|
|
2343
|
+
|
|
2344
|
+
"""
|
|
2345
|
+
text = super().get_identity_options(identity_options)
|
|
2346
|
+
text = text.replace("NO CYCLE", "NOCYCLE")
|
|
2347
|
+
return text
|
|
2348
|
+
|
|
2333
2349
|
|
|
2334
2350
|
class MySQLTypeCompiler(compiler.GenericTypeCompiler):
|
|
2335
2351
|
def _extend_numeric(self, type_: _NumericType, spec: str) -> str:
|
sqlalchemy/dialects/mysql/dml.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/mysql/mariadb.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
10
|
from typing import Any
|
|
11
|
-
from typing import Callable
|
|
12
11
|
|
|
13
12
|
from .base import MariaDBIdentifierPreparer
|
|
14
13
|
from .base import MySQLDialect
|
|
@@ -51,7 +50,7 @@ class MariaDBDialect(MySQLDialect):
|
|
|
51
50
|
type_compiler_cls = MariaDBTypeCompiler
|
|
52
51
|
|
|
53
52
|
|
|
54
|
-
def loader(driver: str) ->
|
|
53
|
+
def loader(driver: str) -> type[MariaDBDialect]:
|
|
55
54
|
dialect_mod = __import__(
|
|
56
55
|
"sqlalchemy.dialects.mysql.%s" % driver
|
|
57
56
|
).dialects.mysql
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/mysql/provision.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -100,7 +100,13 @@ def _mysql_temp_table_keyword_args(cfg, eng):
|
|
|
100
100
|
|
|
101
101
|
@upsert.for_db("mariadb")
|
|
102
102
|
def _upsert(
|
|
103
|
-
cfg,
|
|
103
|
+
cfg,
|
|
104
|
+
table,
|
|
105
|
+
returning,
|
|
106
|
+
*,
|
|
107
|
+
set_lambda=None,
|
|
108
|
+
sort_by_parameter_order=False,
|
|
109
|
+
index_elements=None,
|
|
104
110
|
):
|
|
105
111
|
from sqlalchemy.dialects.mysql import insert
|
|
106
112
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/oracle/base.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -2618,7 +2618,7 @@ class OracleDialect(default.DefaultDialect):
|
|
|
2618
2618
|
and ObjectKind.TABLE in kind
|
|
2619
2619
|
and ObjectKind.MATERIALIZED_VIEW not in kind
|
|
2620
2620
|
):
|
|
2621
|
-
#
|
|
2621
|
+
# can't use EXCEPT ALL / MINUS here because we don't have an
|
|
2622
2622
|
# excludable row vs. the query above
|
|
2623
2623
|
# outerjoin + where null works better on oracle 21 but 11 does
|
|
2624
2624
|
# not like it at all. this is the next best thing
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/oracle/oracledb.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -112,7 +112,7 @@ python-oracledb documentation `Oracle Net Services Connection Strings
|
|
|
112
112
|
For example to use an `Easy Connect string
|
|
113
113
|
<https://download.oracle.com/ocomdocs/global/Oracle-Net-Easy-Connect-Plus.pdf>`_
|
|
114
114
|
with a timeout to prevent connection establishment from hanging if the network
|
|
115
|
-
transport to the database cannot be
|
|
115
|
+
transport to the database cannot be established in 30 seconds, and also setting
|
|
116
116
|
a keep-alive time of 60 seconds to stop idle network connections from being
|
|
117
117
|
terminated by a firewall::
|
|
118
118
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/oracle/provision.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -220,7 +220,7 @@ def _oracle_post_configure_engine(url, engine, follower_ident):
|
|
|
220
220
|
# https://github.com/oracle/python-cx_Oracle/issues/519
|
|
221
221
|
# TODO: oracledb claims to have this feature built in somehow,
|
|
222
222
|
# see if that's in use and/or if it needs to be enabled
|
|
223
|
-
# (or if this
|
|
223
|
+
# (or if this doesn't even apply to the newer oracle's we're using)
|
|
224
224
|
try:
|
|
225
225
|
sc = dbapi_connection.stmtcachesize
|
|
226
226
|
except:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# dialects/oracle/vector.py
|
|
2
|
-
# Copyright (C) 2005-
|
|
2
|
+
# Copyright (C) 2005-2026 the SQLAlchemy authors and contributors
|
|
3
3
|
# <see AUTHORS file>
|
|
4
4
|
#
|
|
5
5
|
# This module is part of SQLAlchemy and is released under
|
|
@@ -132,13 +132,13 @@ class VectorIndexConfig:
|
|
|
132
132
|
:param distance: Enum value from :class:`.VectorDistanceType`
|
|
133
133
|
specifies the metric for calculating distance between VECTORS.
|
|
134
134
|
|
|
135
|
-
:param accuracy:
|
|
135
|
+
:param accuracy: integer. Should be in the range 0 to 100
|
|
136
136
|
Specifies the accuracy of the nearest neighbor search during
|
|
137
137
|
query execution.
|
|
138
138
|
|
|
139
139
|
:param parallel: integer. Specifies degree of parallelism.
|
|
140
140
|
|
|
141
|
-
:param hnsw_neighbors:
|
|
141
|
+
:param hnsw_neighbors: integer. Should be in the range 0 to
|
|
142
142
|
2048. Specifies the number of nearest neighbors considered
|
|
143
143
|
during the search. The attribute :attr:`.VectorIndexConfig.hnsw_neighbors`
|
|
144
144
|
is HNSW index specific.
|
|
@@ -269,7 +269,7 @@ class VECTOR(types.TypeEngine):
|
|
|
269
269
|
"""
|
|
270
270
|
|
|
271
271
|
if dim is not None and not isinstance(dim, int):
|
|
272
|
-
raise TypeError("dim must be an
|
|
272
|
+
raise TypeError("dim must be an integer")
|
|
273
273
|
if storage_format is not None and not isinstance(
|
|
274
274
|
storage_format, VectorStorageFormat
|
|
275
275
|
):
|