Skip to content

Fix: SQL editor executes entire file instead of selection - #213

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
bugfix/211-sql-editor-selection
Jun 21, 2026
Merged

Fix: SQL editor executes entire file instead of selection#213
ZhuchkaTriplesix merged 1 commit into
devfrom
bugfix/211-sql-editor-selection

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #211.

Changes:

  1. Modified postgres_sql_workspace.dart, mysql_sql_workspace.dart, and sqlite_sql_workspace.dart to execute only the highlighted text if there is an active selection.
  2. Modified sqlite_connection.dart to use regular expressions to strip out SQL comments (-- and /* ... */) before checking if a query starts with SELECT or PRAGMA, fixing a bug that returned empty sets for valid queries with leading comments.

@ZhuchkaTriplesix ZhuchkaTriplesix added the bug Something isn't working label Jun 21, 2026
@ZhuchkaTriplesix ZhuchkaTriplesix self-assigned this Jun 21, 2026

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 8118140 into dev Jun 21, 2026
9 checks passed
ZhuchkaTriplesix added a commit that referenced this pull request Jun 21, 2026
* Fix #211: Execute only selected SQL text and strip SQLite comments (#213)

* feat(extensions): implement LocalExtensionRegistry (EXT-2) (#214)

- Add ExtensionPaths for locating ~/.querya/extensions
- Add LocalExtensionRegistry for parsing manifest.json from extensions dir
- Add installPath to ExtensionManifest

* Test: Unit Tests for Extension Registry (EXT-4) (#215)

* test(extensions): add unit tests for LocalExtensionRegistry (EXT-4)

- Mock ExtensionPaths.extensionsDirectory for testing
- Verify registry parses valid manifests
- Verify invalid manifests and plain files are ignored
- Verify registry cache logic

* fix(extensions): use flutter foundation for @VisibleForTesting instead of meta to satisfy linter

* Feat: Migrate Custom Themes to Extension Registry (EXT-3) (#216)

* fix(theme): use braces for multiline if statement

* fix(theme): fix theme registry migration unit tests and watcher path

* fix(theme): remove unused import theme_paths.dart

* test(settings): fix preferences appearance section widget test by mocking extensions dir and utilizing pumpAndSettle

* Fix TOCTOU, ID collisions, redundant scans, and remove legacy theme code (#221)

* chore(release): prepare release 0.4.7
ZhuchkaTriplesix added a commit that referenced this pull request Jun 22, 2026
* Fix #211: Execute only selected SQL text and strip SQLite comments (#213)

* feat(extensions): implement LocalExtensionRegistry (EXT-2) (#214)

- Add ExtensionPaths for locating ~/.querya/extensions
- Add LocalExtensionRegistry for parsing manifest.json from extensions dir
- Add installPath to ExtensionManifest

* Test: Unit Tests for Extension Registry (EXT-4) (#215)

* test(extensions): add unit tests for LocalExtensionRegistry (EXT-4)

- Mock ExtensionPaths.extensionsDirectory for testing
- Verify registry parses valid manifests
- Verify invalid manifests and plain files are ignored
- Verify registry cache logic

* fix(extensions): use flutter foundation for @VisibleForTesting instead of meta to satisfy linter

* Feat: Migrate Custom Themes to Extension Registry (EXT-3) (#216)

* fix(theme): use braces for multiline if statement

* fix(theme): fix theme registry migration unit tests and watcher path

* fix(theme): remove unused import theme_paths.dart

* test(settings): fix preferences appearance section widget test by mocking extensions dir and utilizing pumpAndSettle

* Fix TOCTOU, ID collisions, redundant scans, and remove legacy theme code (#221)

* chore(release): prepare release 0.4.7

* feat(menu): implement File -> Exit to close the application window (#230)

* feat(menu): implement File -> New, Open..., Save actions (#231)

* feat(menu): implement File -> New, Open..., Save actions via Intents/Actions

* refactor(menu): remove unnecessary widgets import in title bar

* feat: implement connection management improvements and read-only mode (Issues #225, #226) (#232)

* feat(connection): implement connection actions and fix layout test hang

* feat(connection): implement Invalidate/Reconnect menu item

* feat: implement Connection -> Read-only mode for database connections

* fix ci

* docs: document SQLite support, read-only mode, and connection actions

* chore(release): prepare pre-release 0.4.7-a
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the bugfix/211-sql-editor-selection branch July 26, 2026 14:36
ZhuchkaTriplesix added a commit that referenced this pull request Jul 27, 2026
* Fix #211: Execute only selected SQL text and strip SQLite comments (#213)

* feat(extensions): implement LocalExtensionRegistry (EXT-2) (#214)

- Add ExtensionPaths for locating ~/.querya/extensions
- Add LocalExtensionRegistry for parsing manifest.json from extensions dir
- Add installPath to ExtensionManifest

* Test: Unit Tests for Extension Registry (EXT-4) (#215)

* test(extensions): add unit tests for LocalExtensionRegistry (EXT-4)

- Mock ExtensionPaths.extensionsDirectory for testing
- Verify registry parses valid manifests
- Verify invalid manifests and plain files are ignored
- Verify registry cache logic

* fix(extensions): use flutter foundation for @VisibleForTesting instead of meta to satisfy linter

* Feat: Migrate Custom Themes to Extension Registry (EXT-3) (#216)

* fix(theme): use braces for multiline if statement

* fix(theme): fix theme registry migration unit tests and watcher path

* fix(theme): remove unused import theme_paths.dart

* test(settings): fix preferences appearance section widget test by mocking extensions dir and utilizing pumpAndSettle

* Fix TOCTOU, ID collisions, redundant scans, and remove legacy theme code (#221)

* chore(release): prepare release 0.4.7
ZhuchkaTriplesix added a commit that referenced this pull request Jul 27, 2026
* Fix #211: Execute only selected SQL text and strip SQLite comments (#213)

* feat(extensions): implement LocalExtensionRegistry (EXT-2) (#214)

- Add ExtensionPaths for locating ~/.querya/extensions
- Add LocalExtensionRegistry for parsing manifest.json from extensions dir
- Add installPath to ExtensionManifest

* Test: Unit Tests for Extension Registry (EXT-4) (#215)

* test(extensions): add unit tests for LocalExtensionRegistry (EXT-4)

- Mock ExtensionPaths.extensionsDirectory for testing
- Verify registry parses valid manifests
- Verify invalid manifests and plain files are ignored
- Verify registry cache logic

* fix(extensions): use flutter foundation for @VisibleForTesting instead of meta to satisfy linter

* Feat: Migrate Custom Themes to Extension Registry (EXT-3) (#216)

* fix(theme): use braces for multiline if statement

* fix(theme): fix theme registry migration unit tests and watcher path

* fix(theme): remove unused import theme_paths.dart

* test(settings): fix preferences appearance section widget test by mocking extensions dir and utilizing pumpAndSettle

* Fix TOCTOU, ID collisions, redundant scans, and remove legacy theme code (#221)

* chore(release): prepare release 0.4.7

* feat(menu): implement File -> Exit to close the application window (#230)

* feat(menu): implement File -> New, Open..., Save actions (#231)

* feat(menu): implement File -> New, Open..., Save actions via Intents/Actions

* refactor(menu): remove unnecessary widgets import in title bar

* feat: implement connection management improvements and read-only mode (Issues #225, #226) (#232)

* feat(connection): implement connection actions and fix layout test hang

* feat(connection): implement Invalidate/Reconnect menu item

* feat: implement Connection -> Read-only mode for database connections

* fix ci

* docs: document SQLite support, read-only mode, and connection actions

* chore(release): prepare pre-release 0.4.7-a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: SQL editor executes entire file instead of selection, breaking multi-statement queries

1 participant