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