Commit 15fcfa5
[Phase 2] Enable MSSQL JSON data type - type mapping & error codes (engine) (#3691)
## What this PR does
Adds support for the SQL Server 2025 `JSON` column type by treating it
exactly like a normal text (`string`) column. Reading, writing,
filtering, and sorting all reuse the paths DAB already has for strings —
no new type, no special handling.
## The change
Two small edits to the engine:
1. **Map the type** — tell DAB that a `JSON` column is a `string`.
2. **Map the errors** — when SQL Server rejects invalid JSON, return
**HTTP 400 (Bad Request)** instead of a generic 500.
Both are covered by new unit tests.
This PR is intentionally scoped to just the engine change. The database
test table and end-to-end (REST/GraphQL) tests are **not** included here
because they need a real SQL Server 2025 database — and our CI currently
runs on LocalDB, which doesn't understand the `JSON` type yet. Those
tests come in the next phase.
## Delivery plan
| Phase | What | Status |
|------|------|--------|
| 1 | Upgrade to .NET 10 + SqlClient 6.x (prerequisite) | ✅ Merged
(#3656) |
| 2 | JSON type + error mapping | This PR |
| 3 | Test table + full REST/GraphQL/MCP tests | Next |
| 4 | Error/filter edge cases + regression | After |
## Notes
- No changes to PostgreSQL, MySQL, DwSql, or CosmosDB.
- Related issue: #2768.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>1 parent 8b4ed96 commit 15fcfa5
5 files changed
Lines changed: 65 additions & 2 deletions
File tree
- src
- Core
- Models
- Resolvers
- Services
- Service.Tests
- OpenApiDocumentor
- UnitTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
92 | 95 | | |
93 | 96 | | |
94 | 97 | | |
| 98 | + | |
95 | 99 | | |
96 | | - | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
114 | 127 | | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
97 | 141 | | |
98 | 142 | | |
0 commit comments