public override void RenameTable(string oldName, string newName) { oldName.MustNotBeEmpty(); newName.MustNotBeEmpty(); Db.ExecuteCommand(string.Format("alter table {0} rename to {1}", PostgresProvider.EscapeIdentifier(oldName), PostgresProvider.EscapeIdentifier(newName))); }
public void npgsql_test_pagination_strings() { var m = new PostgresProvider(Config.SqlServerProviderName); string cnt; string sel; m.MakePaged("select * from test", out sel, out cnt); Assert.Equal("select count(*) from test", cnt); Assert.Equal(string.Format("select * from test limit @{0} offset @{1}", PreparePagedStatement.TakeParameterName, PreparePagedStatement.SkipParameterName), sel); }
public void Setup() { var cfg = Config.Reset(); cfg.GetSettings <EngineSettings>() .WithRandomSuffixAppendedToStreamName(); _provider = new PostgresProvider(); _provider.Initialize(); _journalReader = _provider.CreateJournalReader(); _journalWriter = _provider.CreateJournalWriter(0); _serializer = Config.Current.CreateSerializer(); }
private Provider GetProvider(DbConnectionTypes connectionType, string connectionString) { Provider provider; switch (connectionType) { case DbConnectionTypes.MsSql: provider = new MsSqlProvider(connectionString); break; case DbConnectionTypes.Postgres: provider = new PostgresProvider(connectionString); break; case DbConnectionTypes.Oracle: provider = new OracleProvider(connectionString); break; default: return(null); } return(provider); }
public FileRegistry(PostgresProvider postgresProvider) { this.postgresProvider = postgresProvider; Console.WriteLine("[FileRegistry] has been initialized"); }
protected override string Escape(string name) { return(PostgresProvider.EscapeIdentifier(name)); }
public override void provider_escape_name() { var txt = @"""public.test"""; Assert.Equal(txt, PostgresProvider.EscapeIdentifier("public.test")); }
public void anything_with_dot_will_be_escaped_as_schema_table() { Assert.Equal("\"public\".\"mytable\"", PostgresProvider.EscapeIdentifier("public.mytable")); }
public void common_escaping() { Assert.Equal("\"mytable\"", PostgresProvider.EscapeIdentifier("mytable")); Assert.Equal("\"my table\"", PostgresProvider.EscapeIdentifier("my table")); }
public void already_escaped_id_are_not_escaped() { Assert.Equal("\"public.table\"", PostgresProvider.EscapeIdentifier("\"public.table\"")); Assert.Equal("\"my table\"", PostgresProvider.EscapeIdentifier("\"my table\"")); }
protected override string FormatName(string s) { return(PostgresProvider.EscapeIdentifier(s)); }
protected override void WriteColumn(IndexColumn column) { Builder.Append(PostgresProvider.EscapeIdentifier(column.Name)); }
protected override void WriteTableName() { Builder.Append(PostgresProvider.EscapeIdentifier(Index.TableName)); }