File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed
lib/dl_sqlalchemy_ydb/dl_sqlalchemy_ydb Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change 2828
2929
3030import dl_sqlalchemy_ydb .dialect
31- import dl_sqlalchemy_ydb .compilers as _
3231
3332
3433dl_sqlalchemy_ydb .dialect .register_dialect ()
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55import sqlalchemy as sa
66from sqlalchemy import __version__ as sa_version
77from sqlalchemy .exc import CompileError
8+ from sqlalchemy .ext .compiler import compiles
89from sqlalchemy .sql import literal_column
10+ from sqlalchemy .sql .compiler import SQLCompiler
911from sqlalchemy .util .compat import inspect_getfullargspec
1012import ydb
1113import ydb_sqlalchemy .sqlalchemy as ydb_sa
1214
15+ import dl_sqlalchemy_ydb .dialect as ydb_dialect
16+
1317
1418if sa_version .startswith ("2." ):
1519 from sqlalchemy import (
@@ -164,6 +168,11 @@ class YqlListLiteral(FunctionElement):
164168 inherit_cache = True
165169
166170
171+ @compiles (ydb_dialect .YqlListLiteral )
172+ def _compile_list_literal (element : ydb_dialect .YqlListLiteral , compiler : SQLCompiler , ** kw : Any ) -> str :
173+ return compiler .process (sa .func .AsList (* element .clauses ), ** kw )
174+
175+
167176class CustomYqlTypeCompiler (ydb_sa .YqlTypeCompiler ):
168177 def visit_DATETIME (self , type_ : sa .DATETIME , ** kw : typing .Any ) -> typing .Any :
169178 return self .visit_datetime (type_ , ** kw )
You can’t perform that action at this time.
0 commit comments