ydb-sqlalchemy 0.1.11__py2.py3-none-any.whl → 0.1.13__py2.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.
test/test_suite.py CHANGED
@@ -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
@@ -1 +1 @@
1
- VERSION = "0.1.11"
1
+ VERSION = "0.1.13"
@@ -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():
@@ -66,7 +66,10 @@ class AdaptedAsyncConnection(AdaptedConnection):
66
66
  return await_only(self._connection.get_table_names())
67
67
 
68
68
 
69
+ # TODO(vgvoleg): Migrate to AsyncAdapt_dbapi_cursor and AsyncAdapt_dbapi_connection
69
70
  class AdaptedAsyncCursor:
71
+ _awaitable_cursor_close: bool = False
72
+
70
73
  def __init__(self, cursor: AsyncCursor):
71
74
  self._cursor = cursor
72
75
 
@@ -112,3 +115,6 @@ class AdaptedAsyncCursor:
112
115
 
113
116
  def setoutputsizes(self, *args):
114
117
  pass
118
+
119
+ async def _async_soft_close(self) -> None:
120
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ydb-sqlalchemy
3
- Version: 0.1.11
3
+ Version: 0.1.13
4
4
  Summary: YDB Dialect for SQLAlchemy
5
5
  Home-page: http://github.com/ydb-platform/ydb-sqlalchemy
6
6
  Author: Yandex LLC
@@ -3,24 +3,24 @@ test/conftest.py,sha256=rhWa0EQB9EwO_wAwxPdK17Qi582DdbBE8p5Gv4180Ds,570
3
3
  test/test_core.py,sha256=XvPJ0MtWK2gqGytps4YMUpHtJWKlEqN1rQBUpeeelAg,42859
4
4
  test/test_inspect.py,sha256=c4kc3jc48MCOfllO-ciiYf1vO-HOfuv0xVoXYT1Jxro,1106
5
5
  test/test_orm.py,sha256=jQVVld50zbUwxwgW9ySIWGaNDEOLzHKXjTkdpsG9TpA,1825
6
- test/test_suite.py,sha256=XIW5kxJNKGK4FKE_nza-379_OFOwhP8zcsXEC0lPqWY,30569
6
+ test/test_suite.py,sha256=3Ht_mEG5zzYUA_7YH3Hax5EZgnGhnPrN0PBuJZvdR9I,31104
7
7
  ydb_sqlalchemy/__init__.py,sha256=hX7Gy-KOiHk7B5-0wj3ZmLjk4YDJnSMHIAqxVGn_PJY,181
8
- ydb_sqlalchemy/_version.py,sha256=ZYmaLdPDGWutBbfaGi2OftPL61_FbKbiiNjA7KrAwGs,19
8
+ ydb_sqlalchemy/_version.py,sha256=0BcN8aokkqZB9wuqna4wlHYj0D056RAOE21Mz-Y_m_E,19
9
9
  ydb_sqlalchemy/sqlalchemy/__init__.py,sha256=YAj29mdu0GEG0Udoo0p5ANmEyH6OsAKz5FZc0qn6FDY,16570
10
10
  ydb_sqlalchemy/sqlalchemy/datetime_types.py,sha256=wrI9kpsI_f7Jhbm7Fu0o_S1QoGCLIe6A9jfUwb41aMM,1929
11
- ydb_sqlalchemy/sqlalchemy/dbapi_adapter.py,sha256=HsO4Vhv2nj_Qowt23mUH-jRuNdWKV3ryKnZG5OFp5m0,3109
11
+ ydb_sqlalchemy/sqlalchemy/dbapi_adapter.py,sha256=AH-M0a3dI4A20xrkUMWeZ9QLKqa1GcEioclt9BDGNGI,3297
12
12
  ydb_sqlalchemy/sqlalchemy/dml.py,sha256=k_m6PLOAY7dVzG1gsyo2bB3Lp-o3rhzN0oSX_nfkbFU,310
13
13
  ydb_sqlalchemy/sqlalchemy/json.py,sha256=b4ydjlQjBhlhqGP_Sy2uZVKmt__D-9M7-YLGQMdYGME,1043
14
14
  ydb_sqlalchemy/sqlalchemy/requirements.py,sha256=zm6fcLormtk3KHnbtrBvxfkbG9ZyzNan38HrRB6vC3c,2505
15
15
  ydb_sqlalchemy/sqlalchemy/test_sqlalchemy.py,sha256=QPRgUPsTOqAf0gzWjidsIhTPVkfOILy4SCSgNb1GE7o,1039
16
16
  ydb_sqlalchemy/sqlalchemy/types.py,sha256=BVeC8RSa2nFnI3-Q7XZxCnAolHc_k_kMCfWhUmbi5wo,3823
17
17
  ydb_sqlalchemy/sqlalchemy/compiler/__init__.py,sha256=QqA6r-_bw1R97nQZy5ZSJN724znXg88l4mi5PpqAOxI,492
18
- ydb_sqlalchemy/sqlalchemy/compiler/base.py,sha256=FKtVDKl33hGLcIKpV0UR2ppQ-X2XJ5oyh10FXw4I2uY,19220
18
+ ydb_sqlalchemy/sqlalchemy/compiler/base.py,sha256=zbd9uhV0uxHfMkSTyi4eoZiaiS32yNid4IWfGUo82vA,19433
19
19
  ydb_sqlalchemy/sqlalchemy/compiler/sa14.py,sha256=LanxAnwOiMnsnrY05B0jpmvGn5NXuOKMcxi_6N3obVM,1186
20
20
  ydb_sqlalchemy/sqlalchemy/compiler/sa20.py,sha256=rvVhe-pq5bOyuW4KMMMAD7JIWMzy355eijymBvuPwKw,3421
21
- ydb_sqlalchemy-0.1.11.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
- ydb_sqlalchemy-0.1.11.dist-info/METADATA,sha256=wnHV82yNZg1Q5ZRAzHdO6UnOpGRLqOlF-ob2YJPObKM,5395
23
- ydb_sqlalchemy-0.1.11.dist-info/WHEEL,sha256=Ll72iyqtt6Rbxp-Q7FSafYA1LeRv98X15xcZWRsFEmY,109
24
- ydb_sqlalchemy-0.1.11.dist-info/entry_points.txt,sha256=iJxbKYuliWNBmL0iIiw8MxvOXrSEz5xe5fuEBqMRwCE,267
25
- ydb_sqlalchemy-0.1.11.dist-info/top_level.txt,sha256=iS69Y1GTAcTok0u0oQdxP-Q5iVgUGI71XBsaEUrWhMg,20
26
- ydb_sqlalchemy-0.1.11.dist-info/RECORD,,
21
+ ydb_sqlalchemy-0.1.13.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
22
+ ydb_sqlalchemy-0.1.13.dist-info/METADATA,sha256=Ci_vcXwlXZx21QzRfA1Q9DL8lVXRvf2ngd9l7IVdbWM,5395
23
+ ydb_sqlalchemy-0.1.13.dist-info/WHEEL,sha256=Ll72iyqtt6Rbxp-Q7FSafYA1LeRv98X15xcZWRsFEmY,109
24
+ ydb_sqlalchemy-0.1.13.dist-info/entry_points.txt,sha256=iJxbKYuliWNBmL0iIiw8MxvOXrSEz5xe5fuEBqMRwCE,267
25
+ ydb_sqlalchemy-0.1.13.dist-info/top_level.txt,sha256=iS69Y1GTAcTok0u0oQdxP-Q5iVgUGI71XBsaEUrWhMg,20
26
+ ydb_sqlalchemy-0.1.13.dist-info/RECORD,,