Definition at line 28 of file InsertIntoStatementTests.cs.
void Deveel.Data.Sql.Statements.InsertIntoStatementTests.CreateTestTable |
( |
| ) |
|
|
inlineprivate |
Definition at line 29 of file InsertIntoStatementTests.cs.
30 var tableInfo =
new TableInfo(ObjectName.Parse(
"APP.test_table"));
39 Query.CreateTable(tableInfo);
40 Query.AddPrimaryKey(tableInfo.TableName,
"id",
"PK_TEST_TABLE");
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static BooleanType Boolean()
static NumericType Integer()
void AddColumn(ColumnInfo column)
Adds a new column to the table at the last position of the columns list in the table metadata...
static DateType DateTime()
static SqlReferenceExpression Reference(ObjectName objectName)
static StringType String()
Defines the base class for instances that represent SQL expression tree nodes.
static SqlFunctionCallExpression FunctionCall(ObjectName functionName)
Defines the metadata properties of a table existing within a database.
void Deveel.Data.Sql.Statements.InsertIntoStatementTests.ParseInsertSelect |
( |
| ) |
|
|
inline |
Definition at line 111 of file InsertIntoStatementTests.cs.
112 const string sql =
"INSERT INTO test_table FROM (SELECT * FROM table2 WHERE arg1 = 1)";
114 IEnumerable<SqlStatement> statements = null;
115 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(
Query.
Context, sql));
116 Assert.IsNotNull(statements);
118 var statementList = statements.ToList();
119 Assert.IsNotEmpty(statementList);
120 Assert.AreEqual(1, statementList.Count);
122 var statement = statementList[0];
123 Assert.IsInstanceOf<InsertSelectStatement>(statement);
void Deveel.Data.Sql.Statements.InsertIntoStatementTests.ParserSetInsert |
( |
| ) |
|
|
inline |
Definition at line 89 of file InsertIntoStatementTests.cs.
91 "INSERT INTO test_table SET first_name = 'Antonello', last_name = 'Provenzano', birth_date = TODATE('1980-06-04')";
93 IEnumerable<SqlStatement> statements = null;
94 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(
Query.
Context, sql));
95 Assert.IsNotNull(statements);
97 var statementList = statements.ToList();
98 Assert.IsNotEmpty(statementList);
99 Assert.AreEqual(1, statementList.Count);
101 var statement = statementList[0];
102 Assert.IsInstanceOf<InsertStatement>(statement);
104 var insertStatement = (InsertStatement)statement;
105 Assert.AreEqual(
"test_table", insertStatement.TableName);
106 Assert.AreEqual(3, insertStatement.ColumnNames.Count());
107 Assert.AreEqual(1, insertStatement.Values.Count());
void Deveel.Data.Sql.Statements.InsertIntoStatementTests.ParseValueInsert_MultipleRows |
( |
| ) |
|
|
inline |
Definition at line 66 of file InsertIntoStatementTests.cs.
67 const string sql =
"INSERT INTO test_table (first_name, last_name, birth_date) " +
68 "VALUES ('Antonello', 'Provenzano', TOODATE('1980-06-04')), " +
69 "('Sebastiano', 'Provenzano', TODATE('1981-08-27'))";
71 IEnumerable<SqlStatement> statements = null;
72 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(
Query.
Context, sql));
73 Assert.IsNotNull(statements);
75 var statementList = statements.ToList();
76 Assert.IsNotEmpty(statementList);
77 Assert.AreEqual(1, statementList.Count);
79 var statement = statementList[0];
80 Assert.IsInstanceOf<InsertStatement>(statement);
82 var insertStatement = (InsertStatement)statement;
83 Assert.AreEqual(
"test_table", insertStatement.TableName);
84 Assert.AreEqual(3, insertStatement.ColumnNames.Count());
85 Assert.AreEqual(2, insertStatement.Values.Count());
void Deveel.Data.Sql.Statements.InsertIntoStatementTests.ParseValuesInsert_OneRow |
( |
| ) |
|
|
inline |
Definition at line 44 of file InsertIntoStatementTests.cs.
45 const string sql =
"INSERT INTO test_table (first_name, last_name, birth_date) "+
46 "VALUES ('Antonello', 'Provenzano', TOODATE('1980-06-04'))";
48 IEnumerable<SqlStatement> statements = null;
49 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(
Query.
Context, sql));
50 Assert.IsNotNull(statements);
52 var statementList = statements.ToList();
53 Assert.IsNotEmpty(statementList);
54 Assert.AreEqual(1, statementList.Count);
56 var statement = statementList[0];
57 Assert.IsInstanceOf<InsertStatement>(statement);
59 var insertStatement = (InsertStatement) statement;
60 Assert.AreEqual(
"test_table", insertStatement.TableName);
61 Assert.AreEqual(3, insertStatement.ColumnNames.Count());
62 Assert.AreEqual(1, insertStatement.Values.Count());
The documentation for this class was generated from the following file: