diff --git a/ydb_sqlalchemy/sqlalchemy/__init__.py b/ydb_sqlalchemy/sqlalchemy/__init__.py index c7ad20e..d0ba372 100644 --- a/ydb_sqlalchemy/sqlalchemy/__init__.py +++ b/ydb_sqlalchemy/sqlalchemy/__init__.py @@ -354,7 +354,7 @@ def _format_variables( def _add_declare_for_yql_stmt_vars_impl(self, statement, parameters_types): declarations = "\n".join( [ - f"DECLARE $`{param_name[1:]}` as {str(param_type)};" + f"DECLARE $`{param_name[1:] if param_name.startswith('$') else param_name}` as {str(param_type)};" for param_name, param_type in parameters_types.items() ] ) @@ -415,6 +415,8 @@ def do_executemany( context: Optional[DefaultExecutionContext] = None, ) -> None: operation, parameters = self._prepare_ydb_query(statement, context, parameters, execute_many=True) + print(operation) + print(parameters) cursor.executemany(operation, parameters) def do_execute(