Upgrade SQL version for Pipelines - #3697
Merged
Merged
Conversation
RubenCerna2079
marked this pull request as ready for review
July 7, 2026 17:34
RubenCerna2079
requested review from
Alekhya-Polavarapu,
Aniruddh25,
JerryNixon,
aaronburtle,
anushakolan,
rusamant,
sourabh1007,
souvikghosh04,
stuartpa and
vadeveka
as code owners
July 7, 2026 17:34
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the SQL Server versions used by CI pipelines and test schema initialization so that MsSql/DwSql integration tests can run against SQL Server 2025 features (notably the vector data type), addressing issue #3696.
Changes:
- Added a
vector_type_table(including a max-dimensionvector(1998)case) to the MsSql test schema so schema initialization fails on older SQL versions. - Updated pipeline LocalDB installer URL and version code to SQL 2025 equivalents.
- Updated the Linux SQL Server container image tag used in pipeline setup to SQL Server 2025.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Service.Tests/DatabaseSchema-MsSql.sql | Adds a new vector_type_table and seed data to require SQL Server 2025 vector support during schema init. |
| src/Service.Tests/dab-config.MsSql.json | Minor formatting/EOF change only (no functional config updates). |
| scripts/start-mssql-server.bash | Updates the SQL Server Linux container image tag to 2025. |
| .pipelines/mssql-pipelines.yml | Updates LocalDB installer URL and SQL version code for MsSql pipeline jobs. |
| .pipelines/dwsql-pipelines.yml | Updates LocalDB installer URL and SQL version code for DwSql pipeline jobs. |
Aniruddh25
approved these changes
Jul 8, 2026
souvikghosh04
requested changes
Jul 9, 2026
Aniruddh25
approved these changes
Jul 9, 2026
Aniruddh25
enabled auto-merge (squash)
July 9, 2026 19:07
souvikghosh04
approved these changes
Jul 13, 2026
souvikghosh04
left a comment
Contributor
There was a problem hiding this comment.
thanks for addressing the comments. approved
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 6 pipeline(s). |
RubenCerna2079
disabled auto-merge
July 13, 2026 17:37
RubenCerna2079
enabled auto-merge (squash)
July 13, 2026 17:37
souvikghosh04
added a commit
that referenced
this pull request
Jul 28, 2026
## What this PR does Adds the database test fixture and REST integration tests for SQL Server 2025 `JSON` columns. It builds on Phase 2 (which taught the engine to treat `JSON` as a normal `string`) and proves the behavior end-to-end through the REST API. This follows the exact pattern of the recently merged **vector data type** feature (#3677), and is unblocked by CI now running SQL Server 2025 (#3697). ## What's included - **Test table** — a `profiles` table with an `id` and a `metadata json` column, plus 5 seed rows covering a simple object, an array, a deeply nested object, unicode + emoji, and `NULL`. - **Entity** — a `Profile` entity (REST + GraphQL enabled) in the MsSql test config and config generator. - **REST tests** — `MsSqlRestJsonTypesTests`: read (list, by id, null, array, nested, unicode), insert, update (PUT/PATCH), clear-to-null, and delete. Because DAB treats `JSON` as a string, the tests parse `metadata` and compare it **semantically**, so they're robust to any whitespace / key-order normalization the engine applies. ## No gating needed Unlike the earlier plan, the table is created **unconditionally** (no server-version guard) — CI runs SQL Server 2025 and the schema already uses the 2025-only `vector` type the same way. ## Delivery plan | Phase | What | Status | |------|------|--------| | 1 | .NET 10 + SqlClient 6.x (prerequisite) | ✅ Merged (#3697/#3656) | | 2 | JSON type + error mapping (engine) | ✅ Merged (#3691) | | **3** | **Test fixture + REST CRUD tests (this PR)** | 🚧 In review | | 3b | GraphQL / OpenAPI / MCP schema-discovery tests | Next | | 4 | Error/filter edge cases + regression | After | ## Notes - Requires SQL Server 2025 / Azure SQL (native `json` type). - No changes to PostgreSQL, MySQL, DwSql, or CosmosDB. - Related issue: #2768. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Jul 28, 2026
souvikghosh04
added a commit
that referenced
this pull request
Jul 30, 2026
…QL tests (#3738) ## Why Part of MSSQL native `JSON` support (#2768). Started as Phase 3b **schema-discovery tests**, but review (thanks @aaronburtle) surfaced a real product inconsistency that this PR now also fixes. **The problem:** #2768 requires a `JSON` column to be treated as a normal `string` for **input and output**. But the MSSQL read path (`FOR JSON PATH`) was *inlining* a native `json` column as a nested JSON **object**. Consequences: - REST returned `"metadata": {"role":"admin"}` (object) instead of `"metadata": "{\"role\":\"admin\"}"` (string). - A GraphQL read of the `String`-typed field threw a `GraphQLMapping` error — the `String` leaf resolver calls `JsonElement.GetString()`, which fails on an object. So schema introspection could pass while `profile_by_pk(id:1){ metadata }` failed at runtime. - OpenAPI/GraphQL advertised `string`, contradicting the object runtime — generated clients would mis-model the field. ## What **Engine fix** (`MsSqlQueryBuilder`): the read path now casts a native `json` column (`SqlDbType.Json`) to `NVARCHAR(MAX)` in `WrappedColumns`, so `FOR JSON PATH` emits it as an escaped JSON **string** rather than inlining it as an object. This is the single choke point for REST **and** GraphQL reads. Regular `nvarchar` columns are untouched. Mutations already return `json` as a string via the tabular `OUTPUT` clause, so no change was needed there. **Tests:** | Layer | Test | Asserts | |------|------|---------| | OpenAPI | `JsonTypeSchemaTests` | `metadata` is `type: string` with no `format` in the **response** and both **request-body** schemas (`Profile_NoAutoPK` for POST, `Profile_NoPK` for PUT/PATCH) | | GraphQL introspection | `MsSqlGraphQLJsonSchemaTests` | `Profile.metadata` is the built-in `String` scalar (no custom JSON scalar) | | GraphQL read (new) | `MsSqlGraphQLJsonSchemaTests` | `profile_by_pk(id:1){ metadata }` returns the payload as a JSON **string** — guards against introspection passing while a real read throws | | REST | `MsSqlRestJsonTypesTests` (updated) | flipped back to the string contract: `metadata` is returned as a JSON **string** (`ParseMetadata`/`GetJsonTypeList` assert `JsonValueKind.String`) | > Note: DAB's OpenAPI documentor does not emit `Nullable` on the property schema for **any** column type, so the schema tests assert `type: string` + no `format` (not nullability). ## Intentionally omitted - **MCP `describe_entities` (T010)**: it projects only the config field `name`/`description`, not DB column data types, so there is no JSON-specific behavior to assert. ## Notes - **This PR now includes a product (engine) change**, not tests only. - Requires SQL Server 2025 / Azure SQL (native `json`); CI already runs SQL 2025. - Cannot be run locally (no SQL 2025 here) — relying on CI. ## Delivery plan | Phase | What | Status | |-------|------|--------| | 1 | .NET 10 + SqlClient 6.x | ✅ Merged (#3697/#3656) | | 2 | JSON type + error mapping (engine) | ✅ Merged (#3691) | | 3 | Test fixture + REST CRUD tests | ✅ Merged (#3720) | | **3b** | **json-as-string read fix + OpenAPI/GraphQL discovery & read tests (this PR)** | 🚧 | | 4 | Error/filter edge cases + regression + polish | Next |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
What is this change?
Changed the
SqlLocalDB.msito use the new SQL 2025 version, and updated all the places where we set the SQL version to use SQL 2025.How was this tested?
Using vector data type in follow up PR. If the SQL version is anything less than 2025, the pipeline would fail.
#3677
Sample Request(s)
N/A