Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readOnlyConnectionString #454

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/getting-started/server/database/mssql/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,24 @@ of your database.

The process for modifying the database is described in
[Migrations](./../../../../contributing/database-migrations/).

## Running self-hosted locally

### SQL Server (Dapper)

To set up a self-hosted instance locally, you should follow the instructions
[here](../self-hosted/). Assuming you've defined your user secrets as described in the
[User Secrets](../../user-secrets/) documentation, you'll find that if you don't define the
`readOnlyConnectionString` override as shown below, your self-hosted instance will fall back to use
the regular/default connection string. This can result in unexpected behavior as your self-hosted
instance will be reading from the wrong database.

You can simply copy whatever value you have for `connectionString` and copy it to
`readOnlyConnectionString` in your secrets.json file.

```json
{
"dev:selfHostOverride:globalSettings:sqlServer:connectionString": "Server=localhost;Database=vault_dev_self_host;User Id=sa;Password=your_password_here",
"dev:selfHostOverride:globalSettings:sqlServer:readOnlyConnectionString": "Server=localhost;Database=vault_dev_self_host;User Id=sa;Password=your_password_here"
}
```
Loading