Example #1
0
        public void CommandBuilderQuoting()
        {
            var          cb     = new NpgsqlCommandBuilder();
            const string orig   = "some\"column";
            var          quoted = cb.QuoteIdentifier(orig);

            Assert.That(quoted, Is.EqualTo("\"some\"\"column\""));
            Assert.That(cb.UnquoteIdentifier(quoted), Is.EqualTo(orig));
        }
        private static string InitSnapshotStoreSql(string tableName, string schemaName = null)
        {
            if (string.IsNullOrEmpty(tableName))
            {
                throw new ArgumentNullException("tableName", "Akka.Persistence.PostgreSql snapshot store table name is required");
            }
            schemaName = schemaName ?? "public";

            var cb = new NpgsqlCommandBuilder();

            return(string.Format(SqlSnapshotStoreFormat, cb.QuoteIdentifier(schemaName), cb.QuoteIdentifier(tableName), cb.UnquoteIdentifier(schemaName), cb.UnquoteIdentifier(tableName)));
        }