Skip to content

Commit

Permalink
Fix declare param_name cutting
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvoleg committed Nov 28, 2024
1 parent 6d6e304 commit 0827a0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ydb_sqlalchemy/sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
]
)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 0827a0c

Please sign in to comment.