diff --git a/docs/sqlserver.md b/docs/sqlserver.md index 207ca9b..32b6639 100644 --- a/docs/sqlserver.md +++ b/docs/sqlserver.md @@ -19,14 +19,24 @@ stream Ids are strings there are a number of optimisations applied: Please refer to `CreateSchema.sql` for full schema details. -# Initializing the Database +## Initializing the Database -TODO +The SqlStreamStore database can be initialized in a few ways: -# Using +* **Via SQL Script**: In the project's [`ScriptsV3` folder](https://github.com/SQLStreamStore/SQLStreamStore/tree/master/src/SqlStreamStore.MsSql/ScriptsV3), you'll find [a `CreateSchema.sql` script](https://github.com/SQLStreamStore/SQLStreamStore/blob/master/src/SqlStreamStore.MsSql/ScriptsV3/CreateSchema.sql). Executing the SQL script within a database will install the schema. +* **Via a method**: on the object for a given store, you can call `CreateSchemaIfNotExists()`. This will ensure the schema is created -TODO +## Checking Whether the Schema Matches + +On the object for a store, you can call `CheckSchema()` which will return a result on whether the schema matches expectations. + +This is ideal to run on startup / health checks -# Migrating from V2 Schema to V3 +## Migrating from V2 Schema to V3 -TODO \ No newline at end of file +* **Via SQL Script**: In the project's [`ScriptsV3` folder](https://github.com/SQLStreamStore/SQLStreamStore/tree/master/src/SqlStreamStore.MsSql/ScriptsV3), you'll find [a `Migration_v3.sql` script](https://github.com/SQLStreamStore/SQLStreamStore/blob/master/src/SqlStreamStore.MsSql/ScriptsV3/Migration_v3.sql). Executing the SQL script within a database will migrate the schema from v2 to v3. +* **Via method**: On the object for a store, you can call `Migrate()` which will migrate the schema. + +## Using + +TODO