16 using System.Collections.Generic;
25 using NUnit.Framework;
27 namespace Deveel.Data.Sql.Statements {
31 var query = base.CreateQuery(session);
32 CreateTestTable(query);
47 context.CreateTable(tableInfo);
48 context.AddPrimaryKey(tableInfo.TableName,
"id",
"PK_TEST_TABLE");
52 var table = context.GetMutableTable(
ObjectName.
Parse(
"APP.test_table"));
53 var row = table.NewRow();
80 const string sql =
"UPDATE table SET col1 = 'testUpdate', col2 = 22 WHERE id = 1";
82 IEnumerable<SqlStatement> statements = null;
84 Assert.IsNotNull(statements);
86 var statement = statements.FirstOrDefault();
88 Assert.IsNotNull(statement);
94 const string sql =
"UPDATE table SET col1 = 'testUpdate', col2 = 22 WHERE id = 1 LIMIT 20";
96 IEnumerable<SqlStatement> statements = null;
98 Assert.IsNotNull(statements);
100 var statement = statements.FirstOrDefault();
102 Assert.IsNotNull(statement);
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static DataObject Date(DateTimeOffset value)
static DataObject Integer(int value)
void AddTestData(IQuery context)
static ObjectName Parse(string s)
Parses the given string into a ObjectName object.
static BooleanType Boolean()
void CreateTestTable(IQuery context)
static NumericType Integer()
Describes the name of an object within a database.
static DataObject String(string s)
static DataObject Boolean(SqlBoolean value)
void ParseSimpleUpdateWithLimit()
Represents the foundation class of SQL statements to be executed.
void AddColumn(ColumnInfo column)
Adds a new column to the table at the last position of the columns list in the table metadata...
An isolated session to a given database for a given user, encapsulating the transaction for operation...
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
static DateType DateTime()
override IQuery CreateQuery(ISession session)
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)
static IEnumerable< SqlStatement > Parse(string sqlSource)
Parses a given string into one of more statements.
Defines the metadata properties of a table existing within a database.