Skip to content

feat(sqlserver): data type registry + CREATE TABLE DDL#237

Merged
debba merged 1 commit into
TabularisDB:feat/sql-serverfrom
saurabh500:feat/sqlserver-ddl-types
May 21, 2026
Merged

feat(sqlserver): data type registry + CREATE TABLE DDL#237
debba merged 1 commit into
TabularisDB:feat/sql-serverfrom
saurabh500:feat/sqlserver-ddl-types

Conversation

@saurabh500
Copy link
Copy Markdown
Contributor

Summary

Populates the SQL Server data-type registry so the column-type dropdown in the table designer is functional, and implements \get_create_table_sql\ so table creation works for SQL Server.

Changes

\src-tauri/src/drivers/sqlserver/types.rs\ (new file)

34 SQL Server data types across 7 categories:

  • numeric: TINYINT, SMALLINT, INT, BIGINT, DECIMAL, NUMERIC, SMALLMONEY, MONEY, FLOAT, REAL
  • text: CHAR, VARCHAR, VARCHAR(MAX), TEXT
  • unicode: NCHAR, NVARCHAR, NVARCHAR(MAX), NTEXT
  • binary: BINARY, VARBINARY, VARBINARY(MAX), IMAGE
  • datetime: DATE, TIME, DATETIME, DATETIME2, SMALLDATETIME, DATETIMEOFFSET
  • boolean/other: BIT, UNIQUEIDENTIFIER, XML, SQL_VARIANT, ROWVERSION, TIMESTAMP, HIERARCHYID
  • spatial: GEOGRAPHY, GEOMETRY

INT/BIGINT/SMALLINT/TINYINT marked \supports_auto_increment: true\ (IDENTITY). DECIMAL/NUMERIC marked
equires_precision: true. VARCHAR/NVARCHAR/CHAR/NCHAR marked
equires_length: true.

\src-tauri/src/drivers/sqlserver/mod.rs\

  • Declares \pub mod types\
  • Wires \get_data_types()\ → \ ypes::get_data_types()\
  • Implements \get_create_table_sql\ using \�racket_quote()\ + \qualify()\ from helpers.rs; IDENTITY(1,1) for auto-increment; separate PRIMARY KEY clause (\inline_pk = false)
  • Adds \�racket_quote\ + \qualify\ to the helpers import
  • Adds \ColumnDefinition\ to the models import
  • Replaces the Phase 1 \get_data_types_empty_in_phase1\ test with \get_data_types_includes_core_types\

Test results

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

(Was 119 before; 4 new unit tests in \ ypes.rs.)


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

…ularisDB#150)

Adds src-tauri/src/drivers/sqlserver/types.rs with 34 SQL Server data
types across numeric, text, unicode, binary, datetime, boolean, and
spatial categories.

Wires get_data_types() on SqlServerDriver to call into the new module
instead of returning an empty Vec. This makes the column-type dropdown
functional in the table designer for SQL Server.

Implements get_create_table_sql using bracket_quote() and qualify()
from helpers.rs, with IDENTITY(1,1) for auto-increment columns and a
separate PRIMARY KEY clause (inline_pk = false).

Updates the Phase 1 test that asserted an empty type list to assert
the expected types are present.

Test results: 123 passed; 0 failed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 21, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src-tauri/src/drivers/sqlserver/mod.rs - Wires types module, implements get_create_table_sql using bracket_quote and qualify helpers. Follows existing driver patterns for DDL generation. Test updated from get_data_types_empty_in_phase1 to get_data_types_includes_core_types.
  • src-tauri/src/drivers/sqlserver/types.rs - New file with 34 SQL Server data types across 7 categories. requires_length, requires_precision, and supports_auto_increment flags are set correctly for SQL Server semantics. Includes 4 unit tests covering non-empty list, auto-increment support, length requirement, and precision requirement.

Reviewed by kimi-k2.6 · 1,088,327 tokens

@debba debba merged commit f8fb8f5 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