public override void CanAlterSchema()
        {
            Assert.Ignore("HANA does not support schema like us know schema in hana is a database name");

            var expression = GeneratorTestHelper.GetAlterSchemaExpression();

            var result = Generator.Generate(expression);

            result.ShouldBe("ALTER TABLE \"TestSchema1\".\"TestTable\" SET SCHEMA \"TestSchema2\"");
        }
示例#2
0
        public override void CanCreateSequenceWithCustomSchema()
        {
            var expression = GeneratorTestHelper.GetCreateSequenceExpression();

            expression.Sequence.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE SEQUENCE \"Sequence\" INCREMENT BY 2 MINVALUE 0 MAXVALUE 100 START WITH 2 CACHE 10 CYCLE;");
        }
示例#3
0
        public override void CanCreateIndexWithCustomSchema()
        {
            var expression = GeneratorTestHelper.GetCreateIndexExpression();

            expression.Index.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE INDEX \"TestIndex\" ON \"TestTable1\" (\"TestColumn1\" ASC);");
        }
示例#4
0
        public override void CanCreateIndexWithCustomSchema()
        {
            Assert.Ignore("HANA does not support schema like us know schema in hana is a database name");

            var expression = GeneratorTestHelper.GetCreateIndexExpression();

            expression.Index.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE INDEX \"TestIndex\" ON \"TestSchema\".\"TestTable1\" (\"TestColumn1\" ASC)");
        }
        public override void CanCreateSequenceWithCustomSchema()
        {
            Assert.Ignore("HANA does not support schema like us know schema in hana is a database name");

            var expression = GeneratorTestHelper.GetCreateSequenceExpression();

            expression.Sequence.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE SEQUENCE \"TestSchema\".\"Sequence\" INCREMENT 2 MINVALUE 0 MAXVALUE 100 START WITH 2 CACHE 10 CYCLE");
        }
        public void CanCreateAutoIncrementColumnForInt64()
        {
            var expression = GeneratorTestHelper.GetCreateTableWithAutoIncrementExpression();

            expression.Columns[0].Type = DbType.Int64;

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE COLUMN TABLE \"TestTable1\" (\"TestColumn1\" BIGINT GENERATED ALWAYS AS IDENTITY, \"TestColumn2\" INTEGER);");
        }
        public override void CanAlterColumnWithCustomSchema()
        {
            Assert.Ignore("Hana support change default value with type like bellow");

            var expression = GeneratorTestHelper.GetAlterColumnExpression();

            expression.Column.IsNullable = null;
            expression.SchemaName        = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("ALTER TABLE \"TestTable1\" ALTER (\"TestColumn1\" NVARCHAR(20))");
            //HANA Dosent suport SCHEMA YEAT
        }
        public override void CanCreateForeignKeyWithCustomSchema()
        {
            var expression = GeneratorTestHelper.GetCreateForeignKeyExpression();

            expression.ForeignKey.ForeignTableSchema = "TestSchema";
            expression.ForeignKey.PrimaryTableSchema = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("ALTER TABLE \"TestTable1\" ADD CONSTRAINT \"FK_TestTable1_TestColumn1_TestTable2_TestColumn2\" " +
                            "FOREIGN KEY (\"TestColumn1\") REFERENCES \"TestTable2\" (\"TestColumn2\");");
        }
示例#9
0
        public override void CanCreateNullableColumnWithCustomDomainTypeAndCustomSchema()
        {
            var expression = GeneratorTestHelper.GetCreateColumnExpressionWithNullableCustomType();

            expression.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("ALTER TABLE \"TestTable1\" ADD (\"TestColumn1\" MyDomainType NULL);");
        }
示例#10
0
        public override void CanCreateTableWithCustomColumnTypeWithCustomSchema()
        {
            var expression = GeneratorTestHelper.GetCreateTableExpression();

            expression.Columns[0].IsPrimaryKey = true;
            expression.Columns[1].Type         = null;
            expression.Columns[1].CustomType   = "json";
            expression.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE COLUMN TABLE \"TestTable1\" (\"TestColumn1\" NVARCHAR(255), \"TestColumn2\" json, PRIMARY KEY (\"TestColumn1\"));");
        }
示例#11
0
        public override void CanCreateForeignKeyWithCustomSchema()
        {
            Assert.Ignore("HANA does not support schema like us know schema in hana is a database name");

            var expression = GeneratorTestHelper.GetCreateForeignKeyExpression();

            expression.ForeignKey.ForeignTableSchema = "TestSchema";
            expression.ForeignKey.PrimaryTableSchema = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("ALTER TABLE \"TestTable1\" ADD CONSTRAINT \"FK_TestTable1_TestColumn1_TestTable2_TestColumn2\" " +
                            "FOREIGN KEY (\"TestColumn1\") REFERENCES \"TestTable2\" (\"TestColumn2\")");
        }
示例#12
0
        public override void CanDeleteDataForAllRowsWithCustomSchema()
        {
            var expression = GeneratorTestHelper.GetDeleteDataAllRowsExpression();

            expression.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("DELETE FROM \"TestTable1\" WHERE 1 = 1;");
        }
        public override void CanCreateTableWithCustomColumnTypeWithCustomSchema()
        {
            Assert.Ignore("HANA does not support schema like us know schema in hana is a database name");

            var expression = GeneratorTestHelper.GetCreateTableExpression();

            expression.Columns[0].IsPrimaryKey = true;
            expression.Columns[1].Type         = null;
            expression.Columns[1].CustomType   = "json";
            expression.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("CREATE COLUMN TABLE \"TestSchema\".\"TestTable1\" (\"TestColumn1\" text NOT NULL, \"TestColumn2\" json NOT NULL, PRIMARY KEY (\"TestColumn1\"))");
        }
示例#14
0
        public override void CanAlterColumnWithCustomSchema()
        {
            var expression = GeneratorTestHelper.GetAlterColumnExpression();

            expression.Column.IsNullable = null;
            expression.SchemaName        = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("ALTER TABLE \"TestTable1\" ALTER (\"TestColumn1\" NVARCHAR(20));");
        }
示例#15
0
        public override void CanDeleteDataForAllRowsWithCustomSchema()
        {
            Assert.Ignore("HANA does not support schema like us know schema in hana is a database name");
            var expression = GeneratorTestHelper.GetDeleteDataAllRowsExpression();

            expression.SchemaName = "TestSchema";

            var result = Generator.Generate(expression);

            result.ShouldBe("DELETE FROM \"TestSchema\".\"TestTable1\";");
        }