Definition at line 30 of file SelectStatementTests.cs.
void Deveel.Data.Sql.Statements.SelectStatementTests.AddTestData |
( |
IQuery |
context | ) |
|
|
inlineprivate |
Definition at line 58 of file SelectStatementTests.cs.
59 var table = context.GetMutableTable(ObjectName.Parse(
"APP.test_table"));
60 var row = table.NewRow();
63 row.SetDefault(0, context);
73 row.SetDefault(0, context);
83 row.SetDefault(0, context);
static DataObject Date(DateTimeOffset value)
static DataObject String(string s)
static DataObject Boolean(SqlBoolean value)
Represents a dynamic object that encapsulates a defined SqlType and a compatible constant ISqlObject ...
override ISession Deveel.Data.Sql.Statements.SelectStatementTests.CreateAdminSession |
( |
IDatabase |
database | ) |
|
|
inlineprotectedvirtual |
Reimplemented from Deveel.Data.ContextBasedTest.
Definition at line 31 of file SelectStatementTests.cs.
32 using (var session = base.CreateAdminSession(database)) {
33 using (var query = session.CreateQuery()) {
41 return base.CreateAdminSession(database);
void AddTestData(IQuery context)
void CreateTestTable(IQuery context)
void Deveel.Data.Sql.Statements.SelectStatementTests.CreateTestTable |
( |
IQuery |
context | ) |
|
|
inlineprivate |
Definition at line 44 of file SelectStatementTests.cs.
45 var tableInfo =
new TableInfo(ObjectName.Parse(
"APP.test_table"));
54 context.CreateTable(tableInfo);
55 context.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 StringType String()
Defines the base class for instances that represent SQL expression tree nodes.
static SqlConstantExpression Constant(object value)
static SqlFunctionCallExpression FunctionCall(ObjectName functionName)
Defines the metadata properties of a table existing within a database.
void Deveel.Data.Sql.Statements.SelectStatementTests.ExecuteSimpleOrderedSelect |
( |
| ) |
|
|
inline |
Definition at line 197 of file SelectStatementTests.cs.
198 const string sql =
"SELECT * FROM test_table ORDER BY birth_date DESC";
200 IEnumerable<SqlStatement> statements = null;
201 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
202 Assert.IsNotNull(statements);
204 var statement = statements.FirstOrDefault();
206 Assert.IsNotNull(statement);
207 Assert.IsInstanceOf<SelectStatement>(statement);
210 Assert.DoesNotThrow(() => result = statement.Execute(
Query));
211 Assert.IsNotNull(result);
212 Assert.AreEqual(3, result.RowCount);
214 var firstName = result.
GetValue(0, 1);
216 Assert.AreEqual(
"Roger", firstName.Value.ToString());
Defines the contract to access the data contained into a table of a database.
DataObject GetValue(long rowNumber, int columnOffset)
Gets a single cell within the table that is located at the given column offset and row...
void Deveel.Data.Sql.Statements.SelectStatementTests.ExecuteSimpleSelect |
( |
| ) |
|
|
inline |
Definition at line 178 of file SelectStatementTests.cs.
179 const string sql =
"SELECT * FROM test_table";
181 IEnumerable<SqlStatement> statements = null;
182 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
183 Assert.IsNotNull(statements);
185 var statement = statements.FirstOrDefault();
187 Assert.IsNotNull(statement);
188 Assert.IsInstanceOf<SelectStatement>(statement);
191 Assert.DoesNotThrow(() => result = statement.Execute(
Query));
192 Assert.IsNotNull(result);
193 Assert.AreEqual(3, result.RowCount);
Defines the contract to access the data contained into a table of a database.
void Deveel.Data.Sql.Statements.SelectStatementTests.ParseWithFromClause |
( |
| ) |
|
|
inline |
Definition at line 94 of file SelectStatementTests.cs.
95 const string sql =
"SELECT col1 AS a FROM table";
97 IEnumerable<SqlStatement> statements = null;
98 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
99 Assert.IsNotNull(statements);
101 var statement = statements.FirstOrDefault();
103 Assert.IsNotNull(statement);
104 Assert.IsInstanceOf<SelectStatement>(statement);
106 var selectStatement = (SelectStatement) statement;
107 Assert.IsNotNull(selectStatement.QueryExpression);
108 Assert.IsNull(selectStatement.OrderBy);
void Deveel.Data.Sql.Statements.SelectStatementTests.ParseWithFunction |
( |
| ) |
|
|
inline |
Definition at line 136 of file SelectStatementTests.cs.
137 const string sql =
"SELECT user()";
139 IEnumerable<SqlStatement> statements = null;
140 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
141 Assert.IsNotNull(statements);
143 var statement = statements.FirstOrDefault();
145 Assert.IsNotNull(statement);
146 Assert.IsInstanceOf<SelectStatement>(statement);
148 var selectStatement = (SelectStatement)statement;
149 Assert.IsNotNull(selectStatement.QueryExpression);
150 Assert.IsNull(selectStatement.OrderBy);
152 Assert.IsNotNull(selectStatement.QueryExpression.SelectColumns);
154 var selectCols = selectStatement.QueryExpression.SelectColumns.ToList();
155 Assert.AreEqual(1, selectCols.Count);
void Deveel.Data.Sql.Statements.SelectStatementTests.ParseWithOrderByClause |
( |
| ) |
|
|
inline |
Definition at line 160 of file SelectStatementTests.cs.
161 const string sql =
"SELECT col1 AS a FROM table ORDER BY a ASC";
163 IEnumerable<SqlStatement> statements = null;
164 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
165 Assert.IsNotNull(statements);
167 var statement = statements.FirstOrDefault();
169 Assert.IsNotNull(statement);
170 Assert.IsInstanceOf<SelectStatement>(statement);
172 var selectStatement = (SelectStatement)statement;
173 Assert.IsNotNull(selectStatement.QueryExpression);
174 Assert.IsNotNull(selectStatement.OrderBy);
void Deveel.Data.Sql.Statements.SelectStatementTests.ParseWithVariable |
( |
| ) |
|
|
inline |
Definition at line 112 of file SelectStatementTests.cs.
113 const string sql =
"SELECT :a";
115 IEnumerable<SqlStatement> statements = null;
116 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
117 Assert.IsNotNull(statements);
119 var statement = statements.FirstOrDefault();
121 Assert.IsNotNull(statement);
122 Assert.IsInstanceOf<SelectStatement>(statement);
124 var selectStatement = (SelectStatement)statement;
125 Assert.IsNotNull(selectStatement.QueryExpression);
126 Assert.IsNull(selectStatement.OrderBy);
128 Assert.IsNotNull(selectStatement.QueryExpression.SelectColumns);
130 var selectCols = selectStatement.QueryExpression.SelectColumns.ToList();
131 Assert.AreEqual(1, selectCols.Count);
void Deveel.Data.Sql.Statements.SelectStatementTests.SelectAliasedWithGroupedExpression |
( |
| ) |
|
|
inline |
Definition at line 220 of file SelectStatementTests.cs.
221 const string sql =
"SELECT * FROM test_table t0 WHERE (t0.id = 1 AND t0.id <> 0)";
223 IEnumerable<SqlStatement> statements = null;
224 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
225 Assert.IsNotNull(statements);
227 var statement = statements.FirstOrDefault();
229 Assert.IsNotNull(statement);
230 Assert.IsInstanceOf<SelectStatement>(statement);
233 Assert.DoesNotThrow(() => result = statement.Execute(
Query));
234 Assert.IsNotNull(result);
235 Assert.AreEqual(1, result.RowCount);
Defines the contract to access the data contained into a table of a database.
void Deveel.Data.Sql.Statements.SelectStatementTests.SelectFromAliased |
( |
| ) |
|
|
inline |
Definition at line 239 of file SelectStatementTests.cs.
240 const string sql =
"SELECT * FROM test_table t0 WHERE t0.id = 1";
242 IEnumerable<SqlStatement> statements = null;
243 Assert.DoesNotThrow(() => statements = SqlStatement.Parse(sql));
244 Assert.IsNotNull(statements);
246 var statement = statements.FirstOrDefault();
248 Assert.IsNotNull(statement);
249 Assert.IsInstanceOf<SelectStatement>(statement);
252 Assert.DoesNotThrow(() => result = statement.Execute(
Query));
253 Assert.IsNotNull(result);
254 Assert.AreEqual(1, result.RowCount);
Defines the contract to access the data contained into a table of a database.
The documentation for this class was generated from the following file:
- /var/calculate/remote/distfiles/egit-src/deveeldb.git/src/deveeldb-nunit/Deveel.Data.Sql.Statements/SelectStatementTests.cs