本文整理汇总了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);
}
示例2: FromTable
private FromTable(string tableName, SqlQueryExpression query, string alias)
{
Name = tableName;
SubQuery = query;
Alias = alias;
IsSubQuery = query != null;
}
示例3: Query
public ISelectStatementBuilder Query(SqlQueryExpression expression)
{
if (expression == null)
throw new ArgumentNullException("expression");
queryExpression = expression;
return this;
}
示例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);
}
示例5: SelectStatement
public SelectStatement(SqlQueryExpression queryExpression, IEnumerable<SortColumn> orderBy)
{
if (queryExpression == null)
throw new ArgumentNullException("queryExpression");
QueryExpression = queryExpression;
OrderBy = orderBy;
}
示例6: JoinPart
internal JoinPart(JoinType joinType, SqlQueryExpression subQuery, SqlExpression onExpression)
{
if (subQuery == null)
throw new ArgumentNullException("subQuery");
OnExpression = onExpression;
JoinType = joinType;
SubQuery = subQuery;
}
示例7: FromTableSubQuerySource
internal FromTableSubQuerySource(bool caseInsensitive, string uniqueKey, SqlQueryExpression queryExpression,
QueryExpressionFrom fromSet, ObjectName alias)
{
UniqueName = uniqueKey;
QueryExpression = queryExpression;
QueryFrom = fromSet;
AliasName = alias;
IgnoreCase = caseInsensitive;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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: 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);
}
示例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;
}
示例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);
}