Search in sources :

Example 1 with PGWallProvider

use of com.alibaba.druid.wall.spi.PGWallProvider in project druid by alibaba.

the class WallStatTest_drop_table method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    provider.getConfig().setDropTableAllow(true);
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getDropCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Example 2 with PGWallProvider

use of com.alibaba.druid.wall.spi.PGWallProvider in project druid by alibaba.

the class WallStatTest_insert method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getInsertCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Example 3 with PGWallProvider

use of com.alibaba.druid.wall.spi.PGWallProvider in project druid by alibaba.

the class WallStatTest_select_1 method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    {
        WallTableStat tableStat = provider.getTableStat("lhwbbs_posts_reply");
        Assert.assertEquals(1, tableStat.getSelectCount());
    }
    {
        WallTableStat tableStat = provider.getTableStat("lhwbbs_posts");
        Assert.assertEquals(1, tableStat.getSelectCount());
    }
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Example 4 with PGWallProvider

use of com.alibaba.druid.wall.spi.PGWallProvider in project druid by alibaba.

the class WallStatTest_create_table method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    provider.getConfig().setCreateTableAllow(true);
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getCreateCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Example 5 with PGWallProvider

use of com.alibaba.druid.wall.spi.PGWallProvider in project druid by alibaba.

the class WallStatTest_delete method testPG.

public void testPG() throws Exception {
    WallProvider provider = new PGWallProvider();
    Assert.assertTrue(provider.checkValid(sql));
    WallTableStat tableStat = provider.getTableStat("t");
    Assert.assertEquals(1, tableStat.getDeleteCount());
}
Also used : WallTableStat(com.alibaba.druid.wall.WallTableStat) WallProvider(com.alibaba.druid.wall.WallProvider) MySqlWallProvider(com.alibaba.druid.wall.spi.MySqlWallProvider) OracleWallProvider(com.alibaba.druid.wall.spi.OracleWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider) SQLServerWallProvider(com.alibaba.druid.wall.spi.SQLServerWallProvider) PGWallProvider(com.alibaba.druid.wall.spi.PGWallProvider)

Aggregations

PGWallProvider (com.alibaba.druid.wall.spi.PGWallProvider)11 WallProvider (com.alibaba.druid.wall.WallProvider)10 MySqlWallProvider (com.alibaba.druid.wall.spi.MySqlWallProvider)9 OracleWallProvider (com.alibaba.druid.wall.spi.OracleWallProvider)9 SQLServerWallProvider (com.alibaba.druid.wall.spi.SQLServerWallProvider)9 WallTableStat (com.alibaba.druid.wall.WallTableStat)8 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)1 PGSQLStatementParser (com.alibaba.druid.sql.dialect.postgresql.parser.PGSQLStatementParser)1 PGSchemaStatVisitor (com.alibaba.druid.sql.dialect.postgresql.visitor.PGSchemaStatVisitor)1 WallCheckResult (com.alibaba.druid.wall.WallCheckResult)1 WallConfig (com.alibaba.druid.wall.WallConfig)1 DB2WallProvider (com.alibaba.druid.wall.spi.DB2WallProvider)1 Test (org.junit.Test)1