Skip to content

Support SQL Server in cluster SqlMessageStorage#6441

Draft
sbking wants to merge 4 commits into
Effect-TS:mainfrom
sbking:fix/cluster-mssql-support
Draft

Support SQL Server in cluster SqlMessageStorage#6441
sbking wants to merge 4 commits into
Effect-TS:mainfrom
sbking:fix/cluster-mssql-support

Conversation

@sbking

@sbking sbking commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Stacked on #6440; I'll rebase this PR after it merges.

Summary

SqlMessageStorage contains SQL Server-specific DDL and query paths, but adding an mssql leg to the existing storage suite exposes four SQL Server errors.

  • omit the trailing FOR UPDATE, which is not valid T-SQL in these queries
  • replace nullable UNIQUE constraints with filtered unique indexes so NULL message and reply keys keep the same semantics as the other dialects
  • replace the deprecated TEXT columns with NVARCHAR(MAX) so NULL parameters can be inserted (error 206 otherwise)
  • change the MERGE path to return inserted.id, then read the previous reply when no row was inserted, since SQL Server rejects subqueries in OUTPUT (error 10705)
  • add a SQL Server testcontainer fixture, shared-suite coverage, migration tests, and a patch changeset

Fresh databases use the corrected DDL. An idempotent 0003_mssql_schema_fixes migration updates existing SQL Server schemas and is a no-op on other dialects. The shared suite gains a 30s describe timeout (as in test/fixtures/rpc-e2e.ts) because concurrent per-test migrations against the SQL Server container can exceed the 5s default.

Testing

  • pnpm vitest run packages/platform-node/test/cluster/SqlMessageStorage.test.ts packages/platform-node/test/cluster/SqlMessageStorageMssql.test.ts (39/39 against SQL Server 2022; also green against SQL Server 2025)
  • with only the test commit applied, the SQL Server leg fails 5/8 with errors 1003 and 2627 while PostgreSQL, MySQL, and SQLite pass 29/29
  • pnpm check
  • pnpm lint

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 17, 2026
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9ad877d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

2 participants