示例#1
0
    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);
    }
示例#2
0
    public static void TruncateTable(this ISqlConnectionProvider sqlConnectionProvider, string schema, string table)
    {
        var truncateScript = $"TRUNCATE TABLE {schema}.{table}";

        sqlConnectionProvider.Execute(truncateScript);
    }
示例#3
0
    public static void TruncateTable(this ISqlConnectionProvider sqlConnectionProvider, DbTableNameWithNullableSchema dbTableNameWithNullableSchema)
    {
        var truncateScript = $"TRUNCATE TABLE {dbTableNameWithNullableSchema.ToStringBrackets()}";

        sqlConnectionProvider.Execute(truncateScript);
    }
示例#4
0
    public static void DropTable(this ISqlConnectionProvider sqlConnectionProvider, string schema, string table)
    {
        var dropScript = DropSqlTableReference.GenerateDropTableScript(schema, table);

        sqlConnectionProvider.Execute(dropScript);
    }