private static void CreateOutboxDevelopment(string connectionString) { using var sqlConnection = new SqliteConnection(connectionString); sqlConnection.Open(); using var exists = sqlConnection.CreateCommand(); exists.CommandText = SqliteOutboxBuilder.GetExistsQuery(OUTBOX_TABLE_NAME); using var reader = exists.ExecuteReader(CommandBehavior.SingleRow); if (reader.HasRows) { return; } using var command = sqlConnection.CreateCommand(); command.CommandText = SqliteOutboxBuilder.GetDDL(OUTBOX_TABLE_NAME); command.ExecuteScalar(); }
public void SetupMessageDb() { connectionStringPath = GetUniqueTestDbPathAndCreateDir(); ConnectionString = $"DataSource=\"{connectionStringPath}\""; CreateDatabaseWithTable(ConnectionString, SqliteOutboxBuilder.GetDDL(TableName_Messages)); }