We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be8437f commit 4c54416Copy full SHA for 4c54416
sqlspec/driver/_common.py
@@ -1363,12 +1363,9 @@ def _get_compiled_statement(
1363
if params is not None and not isinstance(params, (list, tuple, dict)):
1364
try:
1365
materialized = list(params)
1366
- # Update the statement's internal parameters with materialized values
1367
- if statement._named_parameters:
1368
- # Named parameters are stored as dict, shouldn't be an iterator
1369
- pass
1370
- else:
1371
- statement._positional_parameters = materialized
+ # Create a copy of the statement with materialized parameters
+ # to avoid consuming the iterator during cache key generation
+ statement = statement.copy(parameters=materialized)
1372
except TypeError:
1373
pass # Not iterable, proceed normally
1374
0 commit comments