{"id":19991549,"url":"https://github.com/Particular/NServiceBus.Persistence.Sql","last_synced_at":"2025-05-04T10:32:03.741Z","repository":{"id":37385039,"uuid":"42932319","full_name":"Particular/NServiceBus.Persistence.Sql","owner":"Particular","description":"Native SQL Persistence for NServiceBus","archived":false,"fork":false,"pushed_at":"2025-04-29T08:01:55.000Z","size":7231,"stargazers_count":38,"open_issues_count":57,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-29T08:39:36.332Z","etag":null,"topics":["nservicebus"],"latest_commit_sha":null,"homepage":"https://docs.particular.net/persistence/sql/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Particular.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-22T12:29:15.000Z","updated_at":"2025-04-17T06:45:36.000Z","dependencies_parsed_at":"2023-12-20T13:18:55.997Z","dependency_job_id":"f0d245fe-b969-4fbf-b152-cc2d91f8a726","html_url":"https://github.com/Particular/NServiceBus.Persistence.Sql","commit_stats":null,"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Particular%2FNServiceBus.Persistence.Sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Particular%2FNServiceBus.Persistence.Sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Particular%2FNServiceBus.Persistence.Sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Particular%2FNServiceBus.Persistence.Sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Particular","download_url":"https://codeload.github.com/Particular/NServiceBus.Persistence.Sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252320485,"owners_count":21729135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nservicebus"],"created_at":"2024-11-13T04:51:48.250Z","updated_at":"2025-05-04T10:32:02.202Z","avatar_url":"https://github.com/Particular.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# NServiceBus.SqlPersistence\n\nNServiceBus.SqlPersistence provides support for NServiceBus to persist in a Sql Database.\n\nIt is part of the [Particular Service Platform](https://particular.net/service-platform), which includes [NServiceBus](https://particular.net/nservicebus) and tools to build, monitor, and debug distributed systems.\n\nSee the [Sql Persistence documentation](https://docs.particular.net/persistence/sql/) for more details on how to use it.\n\n## Running tests locally\n\nThere are tests targeting multiple database engines. These can be installed on your machine or run in a Docker container. The tests require a connection string set up in environment variables (remember that Visual Studio and Rider load these at start up, so restarting the IDE might be necessary).\n\n### SQL Server\n\nFor convenience, scripts have been provided in a `/dev` folder.\n\nDocker:\n\n    docker run --name SqlServer -e \"ACCEPT_EULA=Y\" -e \"SA_PASSWORD=NServiceBusPwd!\" -p 1433:1433 -d  mcr.microsoft.com/mssql/server:2017-latest\n\nEnvironment variable:\n\nAdd an environment variable called `SQLServerConnectionString` with the connection string:\n\n    Server=localhost;User Id=sa;Password=NServiceBusPwd!;Database=nservicebus\n\n### MySql\n\nDocker:\n\n    docker run --rm --name test-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-super-secret-password -e MYSQL_DATABASE=NServiceBus -e MYSQL_USER=nsbuser -e MYSQL_PASSWORD=nsbuser-super-secret-pwd -d mysql:latest\n\nEnvironment variable:\n\nAdd an environment variable called `MySQLConnectionString` with the connection string:\n\n    Server=localhost;Port=3306;Database=NServiceBus;Uid=nsbuser;Pwd=nsbuser-super-secret-pwd;AllowUserVariables=True;AutoEnlist=false\n\n### Postgres\n\nDocker:\n\n    docker run -d --name PostgresDb -v my_dbdata:/var/lib/postgresql/data -p 54320:5432 -e POSTGRES_PASSWORD=super-secret-password postgres:11\n\nEnvironment variable:\n\nAdd an environment variable called `PostgreSqlConnectionString` with the connection string:\n\n    User ID=postgres;Password=super-secret-password;Host=localhost;Port=54320;Database=nservicebus;Pooling=true;\n\n### Oracle\n\nDocker (using the [lightweight community image](https://hub.docker.com/r/gvenzl/oracle-xe) that we also use for CI/CD):\n\n    docker run -d --name oracledb -p 1521:1521 -p 5500:5500 -e ORACLE_PASSWORD=super-secret-password gvenzl/oracle-xe:21.3.0-slim\n\nDocker (official image):\n\n    docker run -d --name oracledb -p 1521:1521 -p 5500:5500 -e ORACLE_PWD=super-secret-password -e ORACLE_CHARACTERSET=AL32UTF8 container-registry.oracle.com/database/express:21.3.0-xe\n\nAdd an environment variable called `OracleConnectionString` with the connection string:\n\n    User Id=system;Password=super-secret-password;Data Source=localhost:1521/XEPDB1;\n\n## Smoke testing SQL Always Encrypted\n\nIn the Azure Portal, set up a dedicated resource group for testing purposes, that's cleaned up when the tests are completed.\n\n1. Create a [SQL database](https://portal.azure.com/#create/Microsoft.SQLDatabase)\n2. Once deployed, access the SQL Server and go to \"Firewalls and virtual networks\" and add a rule that allows access from your local IP address\n3. Choose / download a sample that you want to smoke test, for example the [SQL persistence simple saga sample](https://docs.particular.net/samples/sql-persistence/simple/)\n   - Remove all endpoints except for SQL Server\n   - Adjust the connection string to point to the database you created\n   - Remove the call to `MarkAsComplete()`. That will keep the saga alive so that you can inspect the data in the table\n4. Run the sample first with installers enabled\n5. Check the database. You should see a table for the saga data, with one row in it.\n6. Now we will encrypt some of the columns of the table\n   - Right click on the table, and click 'Encrypt columns'\n   - Choose the columns you want to encrypt, the ´Data´-column should be sufficient\n   - Encryption type: Deterministic\n   - Encryption key: a new one\n   - Select Windows certificate store as a key store provider, under Current user\n   - Choose 'Proceed to finish now'\n   - Query the data to verify that the Data column's content is now encrypted\n7. Adjust to connection string in the sample \n   - include `Column Encryption Setting=Enabled;`\n   - Using a connecting builder, set `ColumnEncryptionSetting = SqlConnectionColumnEncryptionSetting.Enabled`\n8. Rerun the sample, everything should work as expected\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParticular%2FNServiceBus.Persistence.Sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FParticular%2FNServiceBus.Persistence.Sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FParticular%2FNServiceBus.Persistence.Sql/lists"}