public static void CreateTable <T>(this ISqlConnectionProvider sqlConnectionProvider, string schema, string table) { var createTableScript = ClrTypeToSqlDmlCreateStatementGenerator.GetCreateTableScript <T>(schema, table); Console.WriteLine(createTableScript); sqlConnectionProvider.Execute(createTableScript); }
public static void TruncateTable(this ISqlConnectionProvider sqlConnectionProvider, string schema, string table) { var truncateScript = $"TRUNCATE TABLE {schema}.{table}"; sqlConnectionProvider.Execute(truncateScript); }
public static void TruncateTable(this ISqlConnectionProvider sqlConnectionProvider, DbTableNameWithNullableSchema dbTableNameWithNullableSchema) { var truncateScript = $"TRUNCATE TABLE {dbTableNameWithNullableSchema.ToStringBrackets()}"; sqlConnectionProvider.Execute(truncateScript); }
public static void DropTable(this ISqlConnectionProvider sqlConnectionProvider, string schema, string table) { var dropScript = DropSqlTableReference.GenerateDropTableScript(schema, table); sqlConnectionProvider.Execute(dropScript); }