8 namespace Deveel.Data.Sql.Compile {
13 const string sql =
"CREATE VIEW test_view (a, b, c) AS SELECT * FROM test";
15 var result = Compile(sql);
16 Assert.IsNotNull(result);
17 Assert.IsFalse(result.HasErrors);
18 Assert.AreEqual(1, result.Statements.Count);
20 var statement = result.Statements.First();
25 Assert.AreEqual(
"test_view", createView.ViewName);
26 Assert.IsNotEmpty(createView.ColumnNames);
27 Assert.IsNotNull(createView.QueryExpression);
28 Assert.IsFalse(createView.ReplaceIfExists);
33 const string sql =
"CREATE VIEW test_view AS SELECT a, c FROM test";
35 var result = Compile(sql);
36 Assert.IsNotNull(result);
37 Assert.IsFalse(result.HasErrors);
38 Assert.AreEqual(1, result.Statements.Count);
40 var statement = result.Statements.First();
45 Assert.AreEqual(
"test_view", createView.ViewName);
46 Assert.IsNull(createView.ColumnNames);
47 Assert.IsNotNull(createView.QueryExpression);
48 Assert.IsFalse(createView.ReplaceIfExists);