Skip to content

feat(sqlserver): flip driver manifest to editing-ready (#149)#233

Merged
debba merged 1 commit into
TabularisDB:feat/sql-serverfrom
saurabh500:feat/149-flip-editing-ready
May 21, 2026
Merged

feat(sqlserver): flip driver manifest to editing-ready (#149)#233
debba merged 1 commit into
TabularisDB:feat/sql-serverfrom
saurabh500:feat/149-flip-editing-ready

Conversation

@saurabh500
Copy link
Copy Markdown
Contributor

[Phase 2] Flip driver manifest to editing-ready (closes Phase 2)

Closes #149. Final Phase 2 PR — once #215 (insert) and #222 (composite UPDATE/DELETE) merge into feat/sql-server, this one flips the capability bits so the UI actually exposes those editing surfaces.

What changes

Backend — src-tauri/src/drivers/sqlserver/mod.rs

field before after
version "0.1.0" "0.2.0"
description "Microsoft SQL Server (read-only preview)" "Microsoft SQL Server"
capabilities.manage_tables false true
capabilities.readonly true false
capabilities.alter_column false false (Phase 3)
capabilities.create_foreign_keys false false (Phase 3)

Module doc comment updated to describe Phase 2 scope.

manifest_has_phase1_capabilities test renamed to manifest_has_phase2_capabilities, assertions inverted, and added explicit pins that alter_column / create_foreign_keys stay off (Phase 3).

Frontend — src/hooks/useDrivers.ts

Mirrors the Rust manifest in FALLBACK_DRIVERS (version, description, manage_tables, readonly). This is the offline fallback shown before the Tauri command returns; the real manifest comes from the driver itself, but keeping the fallback in sync avoids a flicker.

What does NOT change

Manual QA

Marked done out-of-band against:

  • INSERT / UPDATE / DELETE via the UI on a table with single-column PK
  • Same on a table with composite PK
  • INSERT into an IDENTITY-PK table, with and without supplying the identity value (exercises the SET IDENTITY_INSERT TRY/CATCH wrap from feat(sqlserver): implement insert_record with IDENTITY_INSERT handling (#147) #215)
  • TLS off / on / strict against a local SQL Server 2022 container and Azure SQL
  • Regression: MySQL / Postgres / SQLite editable flows unchanged (no shared code touched)

Sequencing

This PR is the close-out of Phase 2 and is intentionally last. It depends on:

Once those are in, this flip is a one-commit close-out and the whole feat/sql-server branch can be squashed onto main.

Test results

cargo test --lib drivers::sqlserver
test result: ok. 119 passed; 0 failed; 0 ignored

ESLint clean on src/hooks/useDrivers.ts.


Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Closes Phase 2 of the SQL Server driver. Backend + frontend manifest

now report the driver as fully editable for INSERT / UPDATE / DELETE on

tables (single-PK, composite-PK, and IDENTITY-PK shapes).

Changes in src-tauri/src/drivers/sqlserver/mod.rs:

  - version: 0.1.0 -> 0.2.0

  - description: drops '(read-only preview)' suffix

  - DriverCapabilities.manage_tables: false -> true

  - DriverCapabilities.readonly: true -> false

  - module doc comment updated to describe Phase 2 scope

  - manifest_has_phase1_capabilities renamed to

    manifest_has_phase2_capabilities; assertions inverted and

    Phase 3 gates (alter_column, create_foreign_keys) pinned off

Frontend mirror in src/hooks/useDrivers.ts (FALLBACK_DRIVERS):

  - version, description, manage_tables, readonly updated

    to match the Rust manifest

alter_column and create_foreign_keys stay false; DDL generation

is Phase 3 work and is unchanged here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@saurabh500 saurabh500 marked this pull request as ready for review May 21, 2026 00:29
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 21, 2026

Code Review Summary

Status: 3 Observations | Recommendation: Address observations before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 2

No inline issues were found in the diff itself; all observations relate to unchanged code that becomes problematic once the capability bits are flipped.

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src-tauri/src/drivers/sqlserver/mod.rs 394 WARNING: insert_record still returns a Phase 1 error stub ("SQL Server: INSERT disabled in Phase 1 read-only preview") even though readonly is now false. There is no composite variant for INSERT, so the UI will surface a hard error when users attempt to insert rows. If #215 (which implements INSERT) has not yet landed in feat/sql-server, this PR will break the insert flow.
src-tauri/src/drivers/sqlserver/mod.rs 392 SUGGESTION: Section comment // --- CRUD (disabled by readonly=true in manifest) ----------------------- is stale. readonly is now false; update or remove the parenthetical.
src-tauri/src/drivers/sqlserver/mod.rs 100 SUGGESTION: Comment // inert for now (the readonly flag already hides editing surfaces) is stale because readonly is now false. get_data_types() still returns an empty vec, which may leave the CREATE TABLE / clipboard-import UI with no data type options now that editing surfaces are exposed.
Files Reviewed (2 files)
  • src-tauri/src/drivers/sqlserver/mod.rs - capability manifest and test updated; 3 observations in unchanged code
  • src/hooks/useDrivers.ts - fallback manifest updated; no issues

Fix these issues in Kilo Cloud


Reviewed by kimi-k2.6-20260420 · 370,745 tokens

@debba debba merged commit b0448d4 into TabularisDB:feat/sql-server May 21, 2026
1 check passed
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.

2 participants