当前位置: 首页>>代码示例>>C#>>正文


C# Expressions.SqlQueryExpression类代码示例

本文整理汇总了C#中Deveel.Data.Sql.Expressions.SqlQueryExpression的典型用法代码示例。如果您正苦于以下问题:C# SqlQueryExpression类的具体用法?C# SqlQueryExpression怎么用?C# SqlQueryExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SqlQueryExpression类属于Deveel.Data.Sql.Expressions命名空间,在下文中一共展示了SqlQueryExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrepareStatement

        protected override SqlStatement PrepareStatement(IRequest context)
        {
            var tableName = context.Access().ResolveTableName(TableName);
            if (!context.Access().TableExists(tableName))
                throw new ObjectNotFoundException(tableName);

            var queryExpression = new SqlQueryExpression(new[]{SelectColumn.Glob("*") });
            queryExpression.FromClause.AddTable(tableName.FullName);
            queryExpression.WhereExpression = WherExpression;

            var queryFrom = QueryExpressionFrom.Create(context, queryExpression);
            var queryPlan = context.Query.Context.QueryPlanner().PlanQuery(new QueryInfo(context, queryExpression));

            var columns = new List<SqlAssignExpression>();
            foreach (var assignment in Assignments) {
                var columnName = ObjectName.Parse(assignment.ColumnName);

                var refName = queryFrom.ResolveReference(columnName);
                var expression = assignment.Expression.Prepare(queryFrom.ExpressionPreparer);

                var assign = SqlExpression.Assign(SqlExpression.Reference(refName), expression);
                columns.Add(assign);
            }

            return new Prepared(tableName, queryPlan, columns.ToArray(), Limit);
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:26,代码来源:UpdateStatement.cs

示例2: FromTable

 private FromTable(string tableName, SqlQueryExpression query, string alias)
 {
     Name = tableName;
     SubQuery = query;
     Alias = alias;
     IsSubQuery = query != null;
 }
开发者ID:deveel,项目名称:deveeldb,代码行数:7,代码来源:FromTable.cs

示例3: Query

        public ISelectStatementBuilder Query(SqlQueryExpression expression)
        {
            if (expression == null)
                throw new ArgumentNullException("expression");

            queryExpression = expression;
            return this;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:8,代码来源:SelectStatementBuilder.cs

示例4: DeclareInsensitiveCursor

        public static void DeclareInsensitiveCursor(this IRequest context, string cursorName, SqlQueryExpression query, bool withScroll)
        {
            var flags = CursorFlags.Insensitive;
            if (withScroll)
                flags |= CursorFlags.Scroll;

            context.DeclareCursor(cursorName, flags, query);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:RequestExtensions.cs

示例5: SelectStatement

        public SelectStatement(SqlQueryExpression queryExpression, IEnumerable<SortColumn> orderBy)
        {
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");

            QueryExpression = queryExpression;
            OrderBy = orderBy;
        }
开发者ID:furesoft,项目名称:deveeldb,代码行数:8,代码来源:SelectStatement.cs

示例6: JoinPart

        internal JoinPart(JoinType joinType, SqlQueryExpression subQuery, SqlExpression onExpression)
        {
            if (subQuery == null)
                throw new ArgumentNullException("subQuery");

            OnExpression = onExpression;
            JoinType = joinType;
            SubQuery = subQuery;
        }
开发者ID:furesoft,项目名称:deveeldb,代码行数:9,代码来源:JoinPart.cs

示例7: FromTableSubQuerySource

        internal FromTableSubQuerySource(bool caseInsensitive, string uniqueKey, SqlQueryExpression queryExpression,
			QueryExpressionFrom fromSet, ObjectName alias)
        {
            UniqueName = uniqueKey;
            QueryExpression = queryExpression;
            QueryFrom = fromSet;
            AliasName = alias;
            IgnoreCase = caseInsensitive;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:9,代码来源:FromTableSubQuerySource.cs

示例8: PlanQuery

        public IQueryPlanNode PlanQuery(IQueryContext context, SqlQueryExpression queryExpression, IEnumerable<SortColumn> sortColumns)
        {
            var queryFrom = QueryExpressionFrom.Create(context, queryExpression);
            var orderBy = new List<SortColumn>();
            if (sortColumns != null)
                orderBy.AddRange(sortColumns);

            return PlanQuery(context, queryExpression, queryFrom, orderBy);
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:9,代码来源:QueryPlanner.cs

示例9: SelectIntoStatement

        public SelectIntoStatement(SqlQueryExpression queryExpression, SqlExpression reference)
        {
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");
            if (reference == null)
                throw new ArgumentNullException("reference");

            QueryExpression = queryExpression;
            Reference = reference;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:10,代码来源:SelectIntoStatement.cs

示例10: InsertSelectStatement

        public InsertSelectStatement(ObjectName tableName, IEnumerable<string> columnNames, SqlQueryExpression queryExpression)
        {
            if (tableName == null)
                throw new ArgumentNullException("tableName");
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");

            TableName = tableName;
            ColumnNames = columnNames;
            QueryExpression = queryExpression;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:11,代码来源:InsertSelectStatement.cs

示例11: CreateViewStatement

        public CreateViewStatement(string viewName, IEnumerable<string> columnNames, SqlQueryExpression queryExpression)
        {
            if (viewName == null)
                throw new ArgumentNullException("viewName");
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");

            ViewName = viewName;
            ColumnNames = columnNames;
            QueryExpression = queryExpression;
        }
开发者ID:prepare,项目名称:deveeldb,代码行数:11,代码来源:CreateViewStatement.cs

示例12: ViewInfo

        public ViewInfo(TableInfo tableInfo, SqlQueryExpression queryExpression, IQueryPlanNode queryPlan)
        {
            if (tableInfo == null)
                throw new ArgumentNullException("tableInfo");
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");

            TableInfo = tableInfo;
            QueryExpression = queryExpression;
            QueryPlan = queryPlan;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:11,代码来源:ViewInfo.cs

示例13: DeclareInsensitiveCursor

        public void DeclareInsensitiveCursor()
        {
            var query = new SqlQueryExpression(new []{new SelectColumn(SqlExpression.Constant("*")) });
            query.FromClause = new FromClause();
            query.FromClause.AddTable("test_table");

            Assert.DoesNotThrow(() => Query.DeclareInsensitiveCursor("c1", query));

            var exists = Query.ObjectExists(DbObjectType.Cursor, new ObjectName("c1"));
            Assert.IsTrue(exists);
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:11,代码来源:CursorTests.cs

示例14: DeclareCursorStatement

        public DeclareCursorStatement(string cursorName, IEnumerable<CursorParameter> parameters, CursorFlags flags, SqlQueryExpression queryExpression)
        {
            if (queryExpression == null)
                throw new ArgumentNullException("queryExpression");
            if (String.IsNullOrEmpty(cursorName))
                throw new ArgumentNullException("cursorName");

            CursorName = cursorName;
            Parameters = parameters;
            Flags = flags;
            QueryExpression = queryExpression;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:12,代码来源:DeclareCursorStatement.cs

示例15: SelectScalar

        private Field SelectScalar(string column)
        {
            var query = new SqlQueryExpression(new [] {new SelectColumn(SqlExpression.Reference(new ObjectName(column))) });
            query.FromClause.AddTable("seq1");

            var result = AdminQuery.Select(query);
            var row = result.FirstOrDefault();
            if (row == null)
                return Field.Null();

            return row.GetValue(0);
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:12,代码来源:SelectSequenceTests.cs


注:本文中的Deveel.Data.Sql.Expressions.SqlQueryExpression类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。