ux(sql-workspace): query errors are a raw duplicated exception dump that exposes the internal LIMIT wrapper
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start with GenericSqlWorkspace.execute in lib/features/workspace/generic_sql_workspace.dart, the ResultsTab error display, and core/database/database_error_mapper.dart; inspect the separate error display in mongo_query_workspace.dart too. Trace how query wrappers affect driver error text and positions, then define and test mappings for SQLite, PostgreSQL, and MySQL. Done means the example shows a concise summary, wrapper text is hidden, details can be copied, and positions point into the user's SQL.
Written by the indexing model from the issue text.
Description
Problem
A failed query shows the driver exception dumped as-is, twice, including the internal statement the app wrapped around the user's SQL. Example (Demo Playground, SELECT o.id, u.name, ... FROM orders o JOIN users u ... where users has no name):
SqliteFfiException(sqlite_error: 1, , SqliteException(1): while preparing statement, no such column: u.name, SQL logic error (code 1)
Causing statement (at position 29): SELECT * FROM (
SELECT o.id, u.name, ... ORDER BY o.id LIMIT 200
)
LIMIT 5000}) DatabaseException(SqliteException(1): while preparing statement, no such column: u.name, SQL logic error (code 1)
Causing statement (at position 29): SELECT * FROM (
SELECT o.id, ...
)
What is wrong with it:
- The same message appears twice (
SqliteFfiException(...)wrappingDatabaseException(...)), with class names andsqlite_error: 1, ,noise. - It leaks the app's own wrapper (
SELECT * FROM ( ... ) LIMIT 5000, #1144 unique-column wrap) and the position29refers to the wrapper, not to the user's text, so it cannot be used to find the error. - There is no way to jump to the problem, no "Copy error", and the whole text has the same weight (a muted 13 px paragraph).
Where
GenericSqlWorkspace.execute: session.error = e.toString(); (lib/features/workspace/generic_sql_workspace.dart, the generic catch), rendered by ResultsTab (results_mode_error). core/database/database_error_mapper.dart already maps driver errors for connection failures but query errors do not go through it.
Proposal
- Map a query error to
{summary, detail, position?, code?}per driver (SQLite, PostgreSQL, MySQL; others keep the text) and show the summary as the headline:no such column: u.name. - Keep the original text behind "Show details" (collapsed), with a Copy button; strip the app wrapper from it.
- When the driver gives a position, translate it back to the user's text (subtract the wrapper prefix) and put the caret / a squiggle in the editor.
- Same panel for MongoDB's
Query Error(it has its own copy inmongo_query_workspace.dart).
Acceptance
- The example above reads
no such column: u.namewith details collapsed. - No
SELECT * FROM (wrapper text in a user-visible error. - Copy error copies the full original text.
- Unit tests for the mappers of the three SQL drivers (positions mapped to the user's SQL).
Related: #1144.
- Dominant language
- Dart
- Stars
- 23
- Forks
- 1
- Avg merge
- 49m
- Merged PRs (30d)
- 496
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QueryaHub/Querya-Desktop
-
bug P3 ux
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
QueryaHub/Querya-Desktop#1837 ·
Maintainers usually reply within 1 day
-
enhancement P3
Difficulty 4/5 3-5 days Newbie friendliness 50/100
QueryaHub/Querya-Desktop#1838 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
QueryaHub/Querya-Desktop#1690 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 1-2 days Newbie friendliness 55/100
QueryaHub/Querya-Desktop#1683 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
QueryaHub/Querya-Desktop#1625 · 2 comments ·
Maintainers usually reply within 1 day
All issues in QueryaHub/Querya-Desktop
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Docs: correct the unbuilt "full re-verify" claim and three untrue sync commentsPossibly taken @ibanner56 claimed this today. Openarea: sync priority: low severity: trivial type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ibanner56/CallersCompendium#1942 ·
Maintainers usually reply within 1 day
-
[Bug]: 编辑器替换栏关闭按钮错位Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
appshubcc/Bettbox#584 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
transistorsoft/flutter_background_geolocation#1724 · 1 comment ·
-
bug UI: Fluent
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Notsfsssf/pixez-flutter#1430 ·
Maintainers usually reply within 1 day