fix(sqlite): give every session its own handle; clearer data editing (#989) - #990
Merged
Merged
Conversation
…loses #989) SqliteConnection opened files with sqflite's default singleInstance: true, so the pool's read-only browse, table-write and SQL-editor sessions for one file shared a single Database. A Save session reused the read-only browse handle ('attempt to write a readonly database'), and closing any session (idle close after Save, the SQL editor, Disconnect) closed the file for every other view, so the database stopped opening. Open with singleInstance: false. Table Browser now re-acquires its browse session when it was closed under it instead of showing 'Not connected'. Editing UX: - One set of edit controls: the header copy (badge / Revert / Save) is removed from the PostgreSQL, MySQL and SQLite table views, so DDL, Refresh and paging stay visible while editing. The grid toolbar keeps row actions on the left and pins the pending badge, Revert All and Save Changes on the right with standard buttons; narrow widths collapse to icons / 'Save'. - Save errors are explained in plain language (read-only, busy, unique, NOT NULL, foreign key, CHECK, type, stale row, lost connection) with the raw error under Details and a copy button; the SQL workspaces use the same dialog. - The saved toast says '1 change saved' / 'N changes saved'.
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.
Описание изменений
Главная ошибка: SQLite-сессии делили один дескриптор файла
SqliteConnection.connectоткрывал файл с настройкой sqflite по умолчаниюsingleInstance: true. Повторное открытие того же пути возвращало тот же объект базы. Из-за этого сессии пула для одного файла (readOnlyдля просмотра,tableWriteдля Save,readWriteдля SQL-редактора) фактически были одной:attempt to write a readonly database (code 8).Теперь
singleInstance: false, у каждой сессии свой дескриптор.Дополнительно Table Browser заново берёт сессию просмотра, если её закрыли (например после Disconnect в дереве), вместо
Not connected.Удобство редактирования
Проверка
readonly database. С исправлением проходят Save, повторное открытие таблицы после закрытия сессии, Save после Disconnect в дереве, а SQL-редактор видит сохранённые правки.sqlite_connection_test: 3 регрессионных, все падают без исправления;save_error_description_test: разбор ошибок трёх СУБД, диалог, тост;results_tab_test.test/featuresиtest/coreцеликом (1788 тестов), проходят.Не входит
PostgreSQL / MySQL этой ошибкой не затронуты (у них отдельные соединения). Проверял только SQLite.
Связанные Issue
Closes #989