コード例 #1
0
        public void SelectAllColumns()
        {
            var query = (SqlQueryExpression) SqlExpression.Parse("SELECT * FROM test_table");
            var statement = new SelectStatement(query);

            ITable result = statement.Execute(Query);
            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.RowCount);
        }
コード例 #2
0
        public void SelectAllColumns()
        {
            var query     = (SqlQueryExpression)SqlExpression.Parse("SELECT * FROM test_table");
            var statement = new SelectStatement(query);

            ITable result = statement.Execute(Query);

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.RowCount);
        }
コード例 #3
0
        public void SelectAliasedWithGroupedExpression()
        {
            var query     = (SqlQueryExpression)SqlExpression.Parse("SELECT * FROM test_table t0 WHERE (t0.id = 1 AND t0.id <> 0)");
            var statement = new SelectStatement(query);

            var result = statement.Execute(Query);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.RowCount);
        }
コード例 #4
0
        public void SelectAliasedWithGroupedExpression()
        {
            var query = (SqlQueryExpression)SqlExpression.Parse("SELECT * FROM test_table t0 WHERE (t0.id = 1 AND t0.id <> 0)");
            var statement = new SelectStatement(query);

            var result = statement.Execute(Query);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.RowCount);
        }
コード例 #5
0
        public void SimpleOrderedSelect()
        {
            var query = (SqlQueryExpression) SqlExpression.Parse("SELECT * FROM test_table");
            var sort = new[] {new SortColumn(SqlExpression.Reference(new ObjectName("birth_date")), false)};
            var statement = new SelectStatement(query, sort);

            var result = statement.Execute(Query);
            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.RowCount);

            var firstName = result.GetValue(0, 1);

            Assert.AreEqual("Roger", firstName.Value.ToString());
        }
コード例 #6
0
        public void SimpleOrderedSelect()
        {
            var query     = (SqlQueryExpression)SqlExpression.Parse("SELECT * FROM test_table");
            var sort      = new[] { new SortColumn(SqlExpression.Reference(new ObjectName("birth_date")), false) };
            var statement = new SelectStatement(query, sort);

            var result = statement.Execute(Query);

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.RowCount);

            var firstName = result.GetValue(0, 1);

            Assert.AreEqual("Roger", firstName.Value.ToString());
        }