Skip to content

fix: add native JSON type support for SQL Server 2025 - #313

Open
DiscountDarcy wants to merge 1 commit into
coldbox-modules:mainfrom
inLeague:mssql-json
Open

fix: add native JSON type support for SQL Server 2025#313
DiscountDarcy wants to merge 1 commit into
coldbox-modules:mainfrom
inLeague:mssql-json

Conversation

@DiscountDarcy

Copy link
Copy Markdown
Contributor

SQL Server 2025 (v17.x) introduces a native JSON data type with binary-optimized storage and full JSON function support.

  • typeJson() now returns 'JSON' instead of 'NVARCHAR(MAX)'
  • typeJsonb() now returns 'JSON' instead of 'NVARCHAR(MAX)'
  • Updated SqlServerSchemaBuilderSpec json/jsonb DDL expectations

SQL Server 2025 (v17.x) introduces a native JSON data type with
binary-optimized storage and full JSON function support.

- typeJson() now returns 'JSON' instead of 'NVARCHAR(MAX)'
- typeJsonb() now returns 'JSON' instead of 'NVARCHAR(MAX)'
- Updated SqlServerSchemaBuilderSpec json/jsonb DDL expectations
@elpete

elpete commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Thanks for putting this together. I agree that qb should support SQL Server 2025's native JSON type, but I don't want to change the existing SqlServerGrammar globally because qb still supports SQL Server versions where JSON is not a valid native data type.

I'd like this implemented as a dedicated SqlServer2025Grammar that extends SqlServerGrammar and overrides typeJson() and typeJsonb() to return JSON. The existing grammar should continue returning NVARCHAR(MAX). Please include coverage for both the legacy/default SQL Server grammar and the SQL Server 2025 grammar.

The new grammar should also be documented as an explicit opt-in; we should not select it through ordinary SQL Server auto-discovery unless we add reliable version-aware discovery separately.

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