Skip to content

fix: quote convert dry-run identifiers#747

Open
Gares95 wants to merge 1 commit into
simonw:mainfrom
Gares95:fix-convert-dry-run-identifier-quoting
Open

fix: quote convert dry-run identifiers#747
Gares95 wants to merge 1 commit into
simonw:mainfrom
Gares95:fix-convert-dry-run-identifier-quoting

Conversation

@Gares95
Copy link
Copy Markdown

@Gares95 Gares95 commented May 25, 2026

Summary

Fixes convert --dry-run so table and column identifiers are quoted using the existing quote_identifier() helper.

What changed

  • Replaced square-bracket identifier interpolation in the dry-run preview query with quote_identifier().
  • Added a regression test for a table and column containing ].

Why

The normal convert path already uses quote_identifier(), but the dry-run preview path built SQL using square brackets directly. That meant valid identifiers containing ] could fail in --dry-run even though the actual conversion path handled them correctly.

This keeps dry-run behavior consistent with the main conversion path.

Tests

Ran:

python -m pytest tests/test_cli_convert.py -q

Result:

46 passed

Compatibility notes

This only changes generated SQL for the dry-run preview query. Existing ordinary table and column names should behave the same, while identifiers requiring escaping now use the same quoting approach as the main convert implementation.


📚 Documentation preview 📚: https://sqlite-utils--747.org.readthedocs.build/en/747/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant