Skip to content

fix: follow-ups to #1500 (README), #1515 (sql_limit) and #1566 (backslashes in Format SQL) - #1656

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1500-1515-1566-followups
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1500-1515-1566-followups

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Follow-ups found while checking how far the issues mentioned in dev were done. Three small fixes in one PR. CHANGELOG is left alone.

README (#1500)

  • macOS: the DMG installs Querya Desktop.app (release.yml stages "$STAGE/Querya Desktop.app"). The Gatekeeper tip said xattr -cr /Applications/Querya.app, a path that does not exist. It is now xattr -cr "/Applications/Querya Desktop.app", and "drag Querya Desktop".
  • Fedora / RHEL: sudo rpm -i does not install dependencies (libsecret). It is now sudo dnf install ./Querya-Desktop-*-linux.rpm.

injectSqlLimit (#1515)

#1612 made skipping the leading comments an offset walk. injectSqlLimit then still took the comment-free tail and called toUpperCase() on it to check startsWith('SELECT' | 'WITH' | 'VALUES'): one more full copy of a multi-MB script. The keyword is now compared in place at the offset (_hasKeywordAt, ASCII case-insensitive, no word boundary, same as the startsWith it replaces).

Format SQL and backslashes (#1566)

SqlLexicalScanner (from #1640) took \' as an escaped quote, MySQL style, for every dialect. In PostgreSQL (standard strings) and SQLite a backslash is an ordinary character. So select 'C:\', 'not null' was read as the literal 'C:\', ', then code not null, and Format SQL turned it into 'NOT NULL' inside the real second literal: the bug #1566 was about.

  • SqlLexicalScanner.segments(sql, backslashEscapes:). With false, '...' ends at the quote. PostgreSQL E'...' / e'...' strings still escape (an E that ends a longer word such as type'...' is not a prefix).
  • formatSqlScript(sql, dialect:): no backslash escapes for postgres and sqlite; MySQL and unknown keep them.
  • SqlQueryTabSession.dialect, set by GenericSqlWorkspace from widget.dialect, so both the toolbar button and Shift+Alt+F use it.

Tests

  • Scanner: 'C:\' followed by another literal, E'it\'s' / e'a\'b', type'x\', the MySQL default unchanged.
  • Formatter: PostgreSQL and SQLite with a trailing backslash; MySQL \' inside a literal.
  • injectSqlLimit: a 200-line comment header with mixed-case sElEcT; WITH / VALUES; UPDATE and a comment-only script left alone.

Not run locally; CI decides.

README (#1500): the app installed from the DMG is "Querya Desktop.app",
so the xattr command pointed at a path that does not exist; rpm -i does
not install dependencies (libsecret), dnf install ./file.rpm does.

sql_limit (#1515): injectSqlLimit upper-cased the whole comment-free
script to read its first keyword, one more full copy of a large script.
The keyword is now compared in place at the offset after the comments.

Format SQL (#1566): the lexical scanner treated a backslash as a quote
escape everywhere. In PostgreSQL and SQLite it is an ordinary character,
so 'C:\', 'not null' was read as one literal followed by code and the
formatter upper-cased NOT NULL inside the second literal. The scanner
takes backslashEscapes (PostgreSQL E'...' strings still escape), and the
formatter gets it from the tab's dialect; unknown dialects keep the MySQL
rule.
@github-actions github-actions Bot added documentation Improvements or additions to documentation P2 Medium priority / Parity & Refactoring labels Oct 17, 2026
@github-actions github-actions Bot added this to the 0.5.0 milestone Oct 17, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 4caa54c into dev Oct 17, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation P2 Medium priority / Parity & Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant