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
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ Readonly struct, up to 4 inline slots (SQL Server's grammar limit). API: `Leaf`,
61
61
### Context layering
62
62
Six scopes, one home each. **Add new state to whichever class matches its true scope** — when in doubt, ask who outlives whom. The field roster on each class lives in the source XML docs; this section captures only the identity + load-bearing contracts.
63
63
64
-
-**`Simulation`** = server / instance. Holds `SystemHeapTables`, NEWSEQUENTIALID anchor, the `Databases` dict. Public surface (`Simulation` ctor + `CreateDbConnection()`) is the entire external API.
64
+
-**`Simulation`** = server / instance. Holds `SystemHeapTables`, NEWSEQUENTIALID anchor, the `Databases` dict, `ServerCollationName` (string-typed `init`-only knob; defaults to `SQL_Latin1_General_CP1_CI_AS`; mirrors `model.collation` — install-time seed for every freshly-created `Database`, both the lazy `"simulated"` seed and bacpac imports without their own collation declaration; `init` reflects real SQL Server's immutability and Azure's outright block on changing it). Public surface (`Simulation` ctor + `CreateDbConnection()` + `ImportBacpac()` + `AddRemoteSimulation()` + `ServerCollationName`) is the entire external API.
65
65
-**`Database`** (internal) = one database in the instance. Holds `Schemas`, `CompatibilityLevel`, `CollationName`, `Principals`, `Permissions`, `ExtendedProperties`, `FullTextCatalogs`, `DdlTriggers`, the rowversion counter (`@@DBTS`), MVCC version store. `Simulation.Databases` starts empty; the first `CreateDbConnection()` call lazily seeds `Simulation.DefaultDatabaseName` (`"simulated"`) when no `ImportBacpac` has landed a database first. `USE <db>` switches the session to a different entry (Msg 911 on miss); 3-part names route reads across databases (`SELECT * FROM other.dbo.t` works), but cross-DB writes raise `NotSupportedException` via `BatchContext.RejectCrossDatabaseMutation` — issue `USE` first.
66
66
-**`Schema`** (internal) = one namespace inside a database. Holds the object dicts: `HeapTables`, `Functions`, `Views`, `Procedures`, `Sequences`, `Triggers` (DML — share the object namespace), and the separate type namespace `TableTypes` + `AliasTypes` + `XmlSchemaCollections`. Schema-qualified references (`audit.t`, `audit.fn`, `audit.proc`, `audit.seq`, …) route through `Database.Schemas["audit"]`; unqualified falls back to `Database.DefaultSchemaName` (`"dbo"`).
thrownewInvalidOperationException($"A database named '{databaseName}' already exists in this Simulation. Import is a create-only operation; choose a different name via BacpacImportOptions.DatabaseName.");
0 commit comments