You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ SqlServerSimulator is a .NET library that emulates a SQL Server instance in-proc
10
10
11
11
High-fidelity SQL Server simulation, eventually including transactions, locks, MVCC, real allocation tracking (IAM/PFS), and overflow pages — the things that make SQL Server *SQL Server*, not just a SQL parser with a hash table behind it. The fidelity bar is set by the EF Core regression oracle in the `*.Tests.EFCore` project: if EF Core trusts the simulator end-to-end, the simulator is earning its keep. That project must stay green.
12
12
13
+
When SQL Server's actual behavior is quirky or lossy (CP1252's silent `?` replacement for out-of-codepage characters, ANSI trailing-space padding for `=`, `LEN` excluding trailing spaces), mirror it rather than "fixing" it — authenticity over desirability is what makes the simulator a faithful stand-in.
14
+
13
15
A long arc replacing in-memory boxed-object row storage with page-format-aligned encoding completed before this file was written; the simulator now has a single backend with real 8KB pages. Transactions / locks / MVCC are the next phase.
14
16
15
17
## Public API surface
@@ -61,10 +63,13 @@ Single sentence with period. Concrete artifacts named where useful. Squashes cap
61
63
62
64
The main test project is split topically — one file per feature (SELECT, WHERE, TOP, INSERT, etc.). When adding tests, prefer extending an existing topical file over creating a new one with overlapping scope. Storage internals are tested separately because they require `internal` access.
63
65
66
+
Prefer public-API tests when the behavior is reachable from SQL — they exercise the full parse/evaluate path and don't pin internal shapes that may refactor. Reserve `Tests.Internal` for things genuinely unreachable from public SQL: raw storage byte layouts, encoder/decoder invariants, and similar contracts that have no observable public surface.
67
+
64
68
## Live limitations
65
69
66
70
Live state is best read from the code itself and recent commit history. Architectural-level gaps as of the page-storage milestone:
67
71
- Transactions / locks / MVCC: not implemented. The page foundation is in place; the next phase hasn't started.
68
72
- Row-overflow / LOB pages: not modeled. Rows whose encoded size exceeds SQL Server's 8060-byte in-row limit throw at insert time; `varchar(MAX)` is parsed but rejected with a clear "not yet supported" error rather than silently fall through.
69
73
- Heap allocation: flat page list. No IAM/PFS allocation tracking.
70
-
- Cross-category type promotion (string ↔ numeric): not implemented.
74
+
- Cross-category and cross-string-type coercion (string ↔ numeric, varchar ↔ nvarchar): not implemented. `CAST` and the binary-expression `Promote` path both error on these pairs.
75
+
- Pattern matching (`LIKE`), `CONVERT`, fixed-length `char(N)` / `nchar(N)` / `binary(N)`, and identity columns: not modeled.
0 commit comments