本文整理汇总了C#中IQueryPlanNode类的典型用法代码示例。如果您正苦于以下问题:C# IQueryPlanNode类的具体用法?C# IQueryPlanNode怎么用?C# IQueryPlanNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IQueryPlanNode类属于命名空间,在下文中一共展示了IQueryPlanNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleSelectNode
public SimpleSelectNode(IQueryPlanNode child, ObjectName columnName, SqlExpressionType op, SqlExpression expression)
: base(child)
{
ColumnName = columnName;
OperatorType = op;
Expression = expression;
}
示例2: JoinNode
public JoinNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName leftColumnName, SqlExpressionType @operator, SqlExpression rightExpression)
: base(left, right)
{
LeftColumnName = leftColumnName;
Operator = @operator;
RightExpression = rightExpression;
}
示例3: SimpleSelectNode
public SimpleSelectNode(IQueryPlanNode child, ObjectName leftVar, Operator op, Expression rightExpression)
: base(child)
{
this.leftVar = leftVar;
this.op = op;
this.rightExpression = rightExpression;
}
示例4: SortNode
public SortNode(IQueryPlanNode child, ObjectName[] columnNames, bool[] ascending)
: base(child)
{
// How we handle ascending/descending order
// ----------------------------------------
// Internally to the database, all columns are naturally ordered in
// ascending order (start at lowest and end on highest). When a column
// is ordered in descending order, a fast way to achieve this is to take
// the ascending set and reverse it. This works for single columns,
// however some thought is required for handling multiple column. We
// order columns from RHS to LHS. If LHS is descending then this will
// order the RHS incorrectly if we leave as is. Therefore, we must do
// some pre-processing that looks ahead on any descending orders and
// reverses the order of the columns to the right. This pre-processing
// is done in the first pass.
int sz = ascending.Length;
for (int n = 0; n < sz - 1; ++n) {
if (!ascending[n]) { // if descending...
// Reverse order of all columns to the right...
for (int p = n + 1; p < sz; ++p) {
ascending[p] = !ascending[p];
}
}
}
ColumnNames = columnNames;
Ascending = ascending;
}
示例5: NonCorrelatedAnyAllNode
public NonCorrelatedAnyAllNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName[] leftColumnNames, SqlExpressionType subQueryType, bool isAll)
: base(left, right)
{
LeftColumnNames = leftColumnNames;
SubQueryType = subQueryType;
IsAll = isAll;
}
示例6: JoinNode
public JoinNode(IQueryPlanNode left, IQueryPlanNode right, ObjectName leftVar, Operator joinOp, Expression rightExpression)
: base(left, right)
{
this.leftVar = leftVar;
this.joinOp = joinOp;
this.rightExpression = rightExpression;
}
示例7: CachePointNode
public CachePointNode(IQueryPlanNode child)
: base(child)
{
lock (GlobLock) {
id = ((int) DateTime.Now.Ticks << 16) | (GlobId & 0x0FFFF);
++GlobId;
}
}
示例8: GroupNode
/// <summary>
/// Groups over the given columns from the child.
/// </summary>
/// <param name="child"></param>
/// <param name="columns"></param>
/// <param name="groupMaxColumn"></param>
/// <param name="functionList"></param>
/// <param name="nameList"></param>
public GroupNode(IQueryPlanNode child, ObjectName[] columns, ObjectName groupMaxColumn, Expression[] functionList, string[] nameList)
: base(child)
{
this.columns = columns;
this.groupMaxColumn = groupMaxColumn;
this.functionList = functionList;
this.nameList = nameList;
}
示例9: GroupNode
public GroupNode(IQueryPlanNode child, ObjectName[] columnNames, ObjectName groupMaxColumn, SqlExpression[] functions, string[] names)
: base(child)
{
ColumnNames = columnNames;
GroupMaxColumn = groupMaxColumn;
Functions = functions;
Names = names;
}
示例10: PlanTableSource
// How this plan is naturally joined to other plans in the source. A
// plan either has no dependance, a left or a right dependance, or a left
// and right dependance.
public PlanTableSource(IQueryPlanNode plan, ObjectName[] variables, string[] uniqueNames)
{
Plan = plan;
VariableNames = variables;
UniqueNames = uniqueNames;
LeftJoinType = JoinType.None;
RightJoinType = JoinType.None;
IsUpdated = false;
}
示例11: DefineView
public static void DefineView(this IQuery context, ObjectName viewName, IQueryPlanNode queryPlan, bool replaceIfExists)
{
// We have to execute the plan to get the TableInfo that represents the
// result of the view execution.
var table = queryPlan.Evaluate(context);
var tableInfo = table.TableInfo.Alias(viewName);
var viewInfo = new ViewInfo(tableInfo, null, queryPlan);
context.DefineView(viewInfo, replaceIfExists);
}
示例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;
}
示例13: SerializeQueryPlan
public static void SerializeQueryPlan(this ISystemContext context, IQueryPlanNode node, BinaryWriter writer)
{
var nodeType = node.GetType();
var serializers = context.ResolveAllServices<IQueryPlanNodeSerializer>();
foreach (var serializer in serializers) {
if (serializer.CanSerialize(nodeType)) {
serializer.Serialize(node, writer);
return;
}
}
throw new InvalidOperationException(string.Format("Could not find any serializer for node type '{0}'.", nodeType));
}
示例14: TablePlan
public TablePlan(IQueryPlanNode plan, ObjectName[] columnNames, string[] uniqueNames)
{
if (plan == null)
throw new ArgumentNullException("plan");
if (columnNames == null)
throw new ArgumentNullException("columnNames");
Plan = plan;
ColumnNames = columnNames;
UniqueNames = uniqueNames;
LeftJoinType = JoinType.None;
RightJoinType = JoinType.None;
IsUpdated = false;
}
示例15: UpdateTable
public static int UpdateTable(this IQuery context, ObjectName tableName, IQueryPlanNode queryPlan,
IEnumerable<SqlAssignExpression> assignments, int limit)
{
var columnNames = assignments.Select(x => x.ReferenceExpression)
.Cast<SqlReferenceExpression>()
.Select(x => x.ReferenceName.Name).ToArray();
if (!context.UserCanUpdateTable(tableName, columnNames))
throw new MissingPrivilegesException(context.UserName(), tableName, Privileges.Update);
if (!context.UserCanSelectFromPlan(queryPlan))
throw new InvalidOperationException();
var table = context.GetMutableTable(tableName);
if (table == null)
throw new ObjectNotFoundException(tableName);
var updateSet = queryPlan.Evaluate(context);
return table.Update(context, updateSet, assignments, limit);
}