private static string InitSnapshotStoreSql(string tableName, string schemaName = null) { if (string.IsNullOrEmpty(tableName)) throw new ArgumentNullException("tableName", "Akka.Persistence.SqlServer snapshot store table name is required"); schemaName = schemaName ?? "dbo"; var cb = new SqlCommandBuilder(); return string.Format(SqlSnapshotStoreFormat, cb.QuoteIdentifier(schemaName), cb.QuoteIdentifier(tableName), cb.UnquoteIdentifier(schemaName), cb.UnquoteIdentifier(tableName)); }
public void DefaultProperties () { SqlCommandBuilder cb = new SqlCommandBuilder (); Assert.AreEqual ("[", cb.QuotePrefix, "#5"); Assert.AreEqual ("]", cb.QuoteSuffix, "#6"); Assert.AreEqual (".", cb.CatalogSeparator, "#2"); //Assert.AreEqual ("", cb.DecimalSeparator, "#3"); Assert.AreEqual (".", cb.SchemaSeparator, "#4"); Assert.AreEqual (CatalogLocation.Start, cb.CatalogLocation, "#1"); Assert.AreEqual ("[monotest]", cb.QuoteIdentifier ("monotest"), "#7"); Assert.AreEqual ("\"monotest\"", cb.UnquoteIdentifier ("\"monotest\""), "#8"); //Assert.AreEqual (cb.ConflictOption.CompareAllSearchableValues, cb.ConflictDetection); // FIXME: test SetAllValues }
private static string InitMetadataSql(string metadataTable, string schemaName) { if (string.IsNullOrEmpty(metadataTable)) throw new ArgumentNullException("metadataTable", "Akka.Persistence.SqlServer metadata table name is required"); schemaName = schemaName ?? "dbo"; var cb = new SqlCommandBuilder(); return string.Format(SqlMetadataFormat, cb.QuoteIdentifier(schemaName), cb.QuoteIdentifier(metadataTable), cb.UnquoteIdentifier(schemaName), cb.UnquoteIdentifier(metadataTable)); }