public static void DropTable_IfExists()
        {
            var statement = new DropTableStatement(ObjectName.Parse("APP.test_table"), true);

            var sql      = statement.ToString();
            var expected = "DROP TABLE IF EXISTS APP.test_table";

            Assert.AreEqual(expected, sql);
        }
Пример #2
0
        public static void DropTable_IfExists()
        {
            var statement = new DropTableStatement(ObjectName.Parse("APP.test_table"), true);

            var sql = statement.ToString();
            var expected = "DROP TABLE IF EXISTS APP.test_table";

            Assert.AreEqual(expected, sql);
        }
        public void DropReferencedTable()
        {
            var tableName = ObjectName.Parse("APP.test_table1");
            var statement = new DropTableStatement(tableName);

            Assert.Throws<ConstraintViolationException>(() => statement.Execute(Query));

            var exists = Query.TableExists(tableName);
            Assert.IsTrue(exists);
        }
        public void DropNonReferencedTable()
        {
            var tableName = ObjectName.Parse("APP.test_table2");
            var statement = new DropTableStatement(tableName);

            statement.Execute(Query);

            var exists = Query.TableExists(tableName);
            Assert.IsFalse(exists);
        }
        public void DropIfExists_TableNotExists()
        {
            var tableName = ObjectName.Parse("APP.test_table3");
            var statement = new DropTableStatement(tableName, true);

            statement.Execute(Query);

            var exists = Query.TableExists(tableName);
            Assert.IsFalse(exists);
        }
Пример #6
0
        public void DropReferencedTable()
        {
            var tableName = ObjectName.Parse("APP.test_table1");
            var statement = new DropTableStatement(tableName);

            Assert.Throws <ConstraintViolationException>(() => statement.Execute(Query));

            var exists = Query.TableExists(tableName);

            Assert.IsTrue(exists);
        }
Пример #7
0
        public void DropIfExists_TableNotExists()
        {
            var tableName = ObjectName.Parse("APP.test_table3");
            var statement = new DropTableStatement(tableName, true);

            statement.Execute(Query);

            var exists = Query.TableExists(tableName);

            Assert.IsFalse(exists);
        }
Пример #8
0
        public void DropNonReferencedTable()
        {
            var tableName = ObjectName.Parse("APP.test_table2");
            var statement = new DropTableStatement(tableName);

            statement.Execute(Query);

            var exists = Query.TableExists(tableName);

            Assert.IsFalse(exists);
        }
Пример #9
0
 protected override SqlStatement VisitDropTable(DropTableStatement statement)
 {
     return(base.VisitDropTable(statement));
 }
Пример #10
0
 protected virtual SqlStatement VisitDropTable(DropTableStatement statement)
 {
     return new DropTableStatement(statement.TableName, statement.IfExists);
 }
Пример #11
0
 protected override SqlStatement VisitDropTable(DropTableStatement statement)
 {
     return base.VisitDropTable(statement);
 }
Пример #12
0
 protected virtual SqlStatement VisitDropTable(DropTableStatement statement)
 {
     return(new DropTableStatement(statement.TableName, statement.IfExists));
 }