ydb-sqlalchemy 0.1.12__tar.gz → 0.1.14__tar.gz
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.
- {ydb_sqlalchemy-0.1.12/ydb_sqlalchemy.egg-info → ydb_sqlalchemy-0.1.14}/PKG-INFO +2 -2
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/requirements.txt +1 -1
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/setup.py +1 -1
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/test/test_suite.py +13 -0
- ydb_sqlalchemy-0.1.14/ydb_sqlalchemy/_version.py +1 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/__init__.py +27 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/compiler/base.py +4 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/dbapi_adapter.py +6 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14/ydb_sqlalchemy.egg-info}/PKG-INFO +2 -2
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy.egg-info/requires.txt +1 -1
- ydb_sqlalchemy-0.1.12/ydb_sqlalchemy/_version.py +0 -1
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/LICENSE +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/MANIFEST.in +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/README.md +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/pyproject.toml +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/setup.cfg +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/test/__init__.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/test/conftest.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/test/test_core.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/test/test_inspect.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/test/test_orm.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/__init__.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/compiler/__init__.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/compiler/sa14.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/compiler/sa20.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/datetime_types.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/dml.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/json.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/requirements.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/test_sqlalchemy.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/types.py +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy.egg-info/SOURCES.txt +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy.egg-info/dependency_links.txt +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy.egg-info/entry_points.txt +0 -0
- {ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ydb-sqlalchemy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.14
|
|
4
4
|
Summary: YDB Dialect for SQLAlchemy
|
|
5
5
|
Home-page: http://github.com/ydb-platform/ydb-sqlalchemy
|
|
6
6
|
Author: Yandex LLC
|
|
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: sqlalchemy<3.0.0,>=1.4.0
|
|
16
16
|
Requires-Dist: ydb>=3.21.6
|
|
17
|
-
Requires-Dist: ydb-dbapi>=0.1.
|
|
17
|
+
Requires-Dist: ydb-dbapi>=0.1.16
|
|
18
18
|
Provides-Extra: yc
|
|
19
19
|
Requires-Dist: yandexcloud; extra == "yc"
|
|
20
20
|
|
|
@@ -13,7 +13,7 @@ with open("requirements.txt") as f:
|
|
|
13
13
|
|
|
14
14
|
setuptools.setup(
|
|
15
15
|
name="ydb-sqlalchemy",
|
|
16
|
-
version="0.1.
|
|
16
|
+
version="0.1.14", # AUTOVERSION
|
|
17
17
|
description="YDB Dialect for SQLAlchemy",
|
|
18
18
|
author="Yandex LLC",
|
|
19
19
|
author_email="ydb@yandex-team.ru",
|
|
@@ -577,6 +577,19 @@ class ContainerTypesTest(fixtures.TablesTest):
|
|
|
577
577
|
|
|
578
578
|
eq_(connection.execute(sa.select(table)).fetchall(), [(1,), (2,), (3,)])
|
|
579
579
|
|
|
580
|
+
def test_tuple_list_type_bind_variable_text(self, connection):
|
|
581
|
+
table = self.tables.container_types_test
|
|
582
|
+
|
|
583
|
+
connection.execute(sa.insert(table).values([{"id": 1}, {"id": 2}, {"id": 3}]))
|
|
584
|
+
|
|
585
|
+
stmt = select(table.c.id).where(
|
|
586
|
+
sa.text("(id, id) IN :tuple_arr_var").bindparams(
|
|
587
|
+
sa.bindparam("tuple_arr_var", type_=sa.ARRAY(sa.TupleType(sa.Integer, sa.Integer))),
|
|
588
|
+
)
|
|
589
|
+
)
|
|
590
|
+
|
|
591
|
+
eq_(connection.execute(stmt, {"tuple_arr_var": [(1, 1), (2, 2)]}).fetchall(), [(1,), (2,)])
|
|
592
|
+
|
|
580
593
|
|
|
581
594
|
class ConcatTest(fixtures.TablesTest):
|
|
582
595
|
@classmethod
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = "0.1.14"
|
|
@@ -99,6 +99,19 @@ class YdbRequestSettingsCharacteristic(characteristics.ConnectionCharacteristic)
|
|
|
99
99
|
return dialect.get_ydb_request_settings(dbapi_connection)
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
class YdbRetrySettingsCharacteristic(characteristics.ConnectionCharacteristic):
|
|
103
|
+
def reset_characteristic(self, dialect: "YqlDialect", dbapi_connection: ydb_dbapi.Connection) -> None:
|
|
104
|
+
dialect.reset_ydb_retry_settings(dbapi_connection)
|
|
105
|
+
|
|
106
|
+
def set_characteristic(
|
|
107
|
+
self, dialect: "YqlDialect", dbapi_connection: ydb_dbapi.Connection, value: ydb.RetrySettings
|
|
108
|
+
) -> None:
|
|
109
|
+
dialect.set_ydb_retry_settings(dbapi_connection, value)
|
|
110
|
+
|
|
111
|
+
def get_characteristic(self, dialect: "YqlDialect", dbapi_connection: ydb_dbapi.Connection) -> ydb.RetrySettings:
|
|
112
|
+
return dialect.get_ydb_retry_settings(dbapi_connection)
|
|
113
|
+
|
|
114
|
+
|
|
102
115
|
class YqlDialect(StrCompileDialect):
|
|
103
116
|
name = "yql"
|
|
104
117
|
driver = "ydb"
|
|
@@ -150,6 +163,7 @@ class YqlDialect(StrCompileDialect):
|
|
|
150
163
|
{
|
|
151
164
|
"isolation_level": characteristics.IsolationLevelCharacteristic(),
|
|
152
165
|
"ydb_request_settings": YdbRequestSettingsCharacteristic(),
|
|
166
|
+
"ydb_retry_settings": YdbRetrySettingsCharacteristic(),
|
|
153
167
|
}
|
|
154
168
|
)
|
|
155
169
|
|
|
@@ -312,6 +326,19 @@ class YqlDialect(StrCompileDialect):
|
|
|
312
326
|
def get_ydb_request_settings(self, dbapi_connection: ydb_dbapi.Connection) -> ydb.BaseRequestSettings:
|
|
313
327
|
return dbapi_connection.get_ydb_request_settings()
|
|
314
328
|
|
|
329
|
+
def set_ydb_retry_settings(
|
|
330
|
+
self,
|
|
331
|
+
dbapi_connection: ydb_dbapi.Connection,
|
|
332
|
+
value: ydb.RetrySettings,
|
|
333
|
+
) -> None:
|
|
334
|
+
dbapi_connection.set_ydb_retry_settings(value)
|
|
335
|
+
|
|
336
|
+
def reset_ydb_retry_settings(self, dbapi_connection: ydb_dbapi.Connection):
|
|
337
|
+
self.set_ydb_retry_settings(dbapi_connection, ydb.RetrySettings())
|
|
338
|
+
|
|
339
|
+
def get_ydb_retry_settings(self, dbapi_connection: ydb_dbapi.Connection) -> ydb.RetrySettings:
|
|
340
|
+
return dbapi_connection.get_ydb_retry_settings()
|
|
341
|
+
|
|
315
342
|
def create_connect_args(self, url):
|
|
316
343
|
args, kwargs = super().create_connect_args(url)
|
|
317
344
|
# YDB database name should start with '/'
|
|
@@ -228,6 +228,10 @@ class BaseYqlTypeCompiler(StrSQLTypeCompiler):
|
|
|
228
228
|
ydb_type = ydb.DecimalType(precision, scale)
|
|
229
229
|
elif isinstance(type_, (types.ListType, sa.ARRAY)):
|
|
230
230
|
ydb_type = ydb.ListType(self.get_ydb_type(type_.item_type, is_optional=False))
|
|
231
|
+
elif isinstance(type_, sa.TupleType):
|
|
232
|
+
ydb_type = ydb.TupleType()
|
|
233
|
+
for item_type in type_.types:
|
|
234
|
+
ydb_type.add_element(self.get_ydb_type(item_type, is_optional=False))
|
|
231
235
|
elif isinstance(type_, types.StructType):
|
|
232
236
|
ydb_type = ydb.StructType()
|
|
233
237
|
for field, field_type in type_.fields_types.items():
|
|
@@ -56,6 +56,12 @@ class AdaptedAsyncConnection(AdaptedConnection):
|
|
|
56
56
|
def get_ydb_request_settings(self) -> ydb.BaseRequestSettings:
|
|
57
57
|
return self._connection.get_ydb_request_settings()
|
|
58
58
|
|
|
59
|
+
def set_ydb_retry_settings(self, value: ydb.RetrySettings) -> None:
|
|
60
|
+
self._connection.set_ydb_retry_settings(value)
|
|
61
|
+
|
|
62
|
+
def get_ydb_retry_settings(self) -> ydb.RetrySettings:
|
|
63
|
+
return self._connection.get_ydb_retry_settings()
|
|
64
|
+
|
|
59
65
|
def describe(self, table_path: str):
|
|
60
66
|
return await_only(self._connection.describe(table_path))
|
|
61
67
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ydb-sqlalchemy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.14
|
|
4
4
|
Summary: YDB Dialect for SQLAlchemy
|
|
5
5
|
Home-page: http://github.com/ydb-platform/ydb-sqlalchemy
|
|
6
6
|
Author: Yandex LLC
|
|
@@ -14,7 +14,7 @@ Description-Content-Type: text/markdown
|
|
|
14
14
|
License-File: LICENSE
|
|
15
15
|
Requires-Dist: sqlalchemy<3.0.0,>=1.4.0
|
|
16
16
|
Requires-Dist: ydb>=3.21.6
|
|
17
|
-
Requires-Dist: ydb-dbapi>=0.1.
|
|
17
|
+
Requires-Dist: ydb-dbapi>=0.1.16
|
|
18
18
|
Provides-Extra: yc
|
|
19
19
|
Requires-Dist: yandexcloud; extra == "yc"
|
|
20
20
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = "0.1.12"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/compiler/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy/sqlalchemy/test_sqlalchemy.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ydb_sqlalchemy-0.1.12 → ydb_sqlalchemy-0.1.14}/ydb_sqlalchemy.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|