Repository navigation
fix: follow-ups to #1500 (README), #1515 (sql_limit) and #1566 (backslashes in Format SQL) - #1656
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups found while checking how far the issues mentioned in
devwere done. Three small fixes in one PR. CHANGELOG is left alone.README (#1500)
Querya Desktop.app(release.ymlstages"$STAGE/Querya Desktop.app"). The Gatekeeper tip saidxattr -cr /Applications/Querya.app, a path that does not exist. It is nowxattr -cr "/Applications/Querya Desktop.app", and "drag Querya Desktop".sudo rpm -idoes not install dependencies (libsecret). It is nowsudo dnf install ./Querya-Desktop-*-linux.rpm.injectSqlLimit(#1515)#1612 made skipping the leading comments an offset walk.
injectSqlLimitthen still took the comment-free tail and calledtoUpperCase()on it to checkstartsWith('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 thestartsWithit 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. Soselect 'C:\', 'not null'was read as the literal'C:\', ', then codenot null, and Format SQL turned it into'NOT NULL'inside the real second literal: the bug #1566 was about.SqlLexicalScanner.segments(sql, backslashEscapes:). Withfalse,'...'ends at the quote. PostgreSQLE'...'/e'...'strings still escape (anEthat ends a longer word such astype'...'is not a prefix).formatSqlScript(sql, dialect:): no backslash escapes forpostgresandsqlite; MySQL and unknown keep them.SqlQueryTabSession.dialect, set byGenericSqlWorkspacefromwidget.dialect, so both the toolbar button and Shift+Alt+F use it.Tests
'C:\'followed by another literal,E'it\'s'/e'a\'b',type'x\', the MySQL default unchanged.\'inside a literal.injectSqlLimit: a 200-line comment header with mixed-casesElEcT;WITH/VALUES;UPDATEand a comment-only script left alone.Not run locally; CI decides.