Skip to content

feat: share the statement runner and query result across features - #103

Merged
cevheri merged 2 commits into
mainfrom
feat/92-statement-runner
Oct 23, 2026
Merged

cevheri merged 2 commits into
mainfrom
feat/92-statement-runner

Conversation

@cevheri

@cevheri cevheri commented Oct 23, 2026

Copy link
Copy Markdown
Member

Moves the query models and newQueryId to lib/shared/models and adds IStatementRepository with StatementRepository, so the object browser can run a statement without importing the SQL editor. SqlEditorRepository.run delegates to it, so the app has one /db/query call.

  • database is sent only when set, as a JSON number; runScript sends a page as options.
  • vectorColumns is read into VectorColumn, unknown ids kept as strings, malformed entries left out.
  • pagination, wasLimited, warnings and openTransaction are read strictly in the query, script statement and transaction readers.
  • appendResultPage ports Studio's append rule and its test cases.
  • The coverage table drives IStatementRepository.run; MockIStatementRepository added; docs/architecture.md updated.

Local: format 0 changed, analyze clean, 3081 tests pass, l10n no diff.

Closes #92

Move QueryResult, QueryWarning, QueryPage, QueryPagination and newQueryId to lib/shared/models, add VectorColumn and QueryResult.vectorColumns, and add IStatementRepository with StatementRepository (POST /db/query) in lib/infrastructure/studio, which SqlEditorRepository.run now delegates to.
A run sends database only when set, as a JSON number, and runScript sends a page as options.
The query reader reads pagination, wasLimited, warnings and openTransaction strictly in every reader that builds a QueryResult, script statements and transaction runs included.
appendResultPage ports Studio's Load more rule with its unit cases.
A pagination without wasLimited now fails the read, since Studio always sends it and a missing one would hide a bound.
StatementRepository.run throws an ArgumentError for a negative database before sending, as Studio refuses it with a 400.
appendResultPage says why it tests isNotEmpty where Studio uses ??.
@cevheri
cevheri merged commit 940286e into main Oct 23, 2026
6 checks passed
@cevheri
cevheri deleted the feat/92-statement-runner branch October 23, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shared statement runner and query result: database field, script options, loss notices and page append

1 participant