本文整理汇总了C#中ISqlNode类的典型用法代码示例。如果您正苦于以下问题:C# ISqlNode类的具体用法?C# ISqlNode怎么用?C# ISqlNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISqlNode类属于命名空间,在下文中一共展示了ISqlNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetDirection
private void GetDirection(ISqlNode node)
{
var childNode = node.ChildNodes.FirstOrDefault();
if (childNode == null)
return;
childNode = childNode.ChildNodes.FirstOrDefault();
if (childNode == null)
throw new SqlParseException();
if (String.Equals(childNode.NodeName, "NEXT", StringComparison.OrdinalIgnoreCase) ||
String.Equals(childNode.NodeName, "PRIOR", StringComparison.OrdinalIgnoreCase) ||
String.Equals(childNode.NodeName, "FIRST", StringComparison.OrdinalIgnoreCase) ||
String.Equals(childNode.NodeName, "LAST", StringComparison.OrdinalIgnoreCase)) {
Direction = childNode.NodeName.ToUpper();
} else if (String.Equals(childNode.NodeName, "ABSOLUTE", StringComparison.OrdinalIgnoreCase) ||
String.Equals(childNode.NodeName, "RELATIVE", StringComparison.OrdinalIgnoreCase)) {
var positionNode = childNode.ChildNodes.FirstOrDefault();
if (positionNode == null)
throw new SqlParseException("The position expression if required in an ABSOLUTE or RELATIVE fetch.");
var expression = positionNode as IExpressionNode;
if (expression == null)
throw new SqlParseException();
Direction = childNode.NodeName.ToUpper();
Position = expression;
}
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:29,代码来源:FetchStatementNode.cs
示例2: GetOrderBy
private void GetOrderBy(ISqlNode node)
{
var listNode = node.FindByName("sorted_def_list");
if (listNode != null) {
OrderBy = listNode.ChildNodes.Cast<OrderByNode>();
}
}
开发者ID:prepare,项目名称:deveeldb,代码行数:7,代码来源:SelectStatementNode.cs
示例3: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is TableColumnNode)
Column = (TableColumnNode) node;
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:AddColumnNode.cs
示例4: Append
public void Append(ISqlNode sqlNode)
{
if (sqlNode == null)
return;
sqlNode.Render(this);
}
开发者ID:mikezhuyuan,项目名称:EQuery,代码行数:7,代码来源:SqlWriter.cs
示例5: VisitFirst
private ISqlNode VisitFirst(ISqlNode parent, MethodCallExpression expr)
{
var select = (ISelect)parent;
select.Top = new Top(new ConstantProvider(_context, 1));
return select;
}
开发者ID:mikezhuyuan,项目名称:EQuery,代码行数:7,代码来源:QueryConverter.cs
示例6: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is IExpressionNode)
Password = (IExpressionNode) node;
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:SetPasswordNode.cs
示例7: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is SqlKeyNode) {
var keyNode = (SqlKeyNode) node;
if (String.Equals(keyNode.Text, "NULL", StringComparison.OrdinalIgnoreCase)) {
if (notSeen) {
ConstraintType = ConstraintTypeNames.NotNull;
} else {
ConstraintType = ConstraintTypeNames.Null;
}
} else if (String.Equals(keyNode.Text, "NOT", StringComparison.OrdinalIgnoreCase)) {
notSeen = true;
} else if (String.Equals(keyNode.Text, "REFERENCES", StringComparison.OrdinalIgnoreCase)) {
ConstraintType = ConstraintTypeNames.ForeignKey;
} else if (String.Equals(keyNode.Text, "CHECK", StringComparison.OrdinalIgnoreCase)) {
ConstraintType = ConstraintTypeNames.Check;
} else if (String.Equals(keyNode.Text, "PRIMARY", StringComparison.OrdinalIgnoreCase)) {
ConstraintType = ConstraintTypeNames.PrimaryKey;
} else if (String.Equals(keyNode.Text, "UNIQUE", StringComparison.OrdinalIgnoreCase)) {
ConstraintType = ConstraintTypeNames.UniqueKey;
}
} else if (node is IExpressionNode) {
CheckExpression = (IExpressionNode) node;
} else if (node is ObjectNameNode) {
if (!String.Equals(ConstraintType, ConstraintTypeNames.ForeignKey, StringComparison.OrdinalIgnoreCase))
throw new InvalidOperationException();
ReferencedTable = ((ObjectNameNode) node);
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:32,代码来源:ColumnConstraintNode.cs
示例8: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is TableConstraintNode)
Constraint = (TableConstraintNode) node;
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:AddConstraintNode.cs
示例9: OnChildNode
/// <inheritdoc/>
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node.NodeName == "sql_expression_list")
GetExpressions(node);
return base.OnChildNode(node);
}
开发者ID:prepare,项目名称:deveeldb,代码行数:8,代码来源:SqlExpressionTupleNode.cs
示例10: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is IdentifierNode)
Text = ((IdentifierNode) node).Text;
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:LabelNode.cs
示例11: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node.NodeName.Equals("exception_name_opt"))
ExceptionName = node.FindNode<IdentifierNode>().Text;
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:7,代码来源:RaiseStatementNode.cs
示例12: Visit
private ISqlNode Visit(ISqlNode parent, Expression expr)
{
if (expr.NodeType == ExpressionType.Constant && expr.Type.IsGenericType(typeof(Queryable<>)))
return VisitRoot(parent, expr);
if(expr.NodeType == ExpressionType.Call)
{
var call = (MethodCallExpression) expr;
switch (call.Method.Name)
{
case "Where":
return VisitWhere(Visit(parent, call.Arguments[0]), call);
case "OrderBy":
return VisitOrderBy(Visit(parent, call.Arguments[0]), call);
case "ThenBy":
return VisitThenBy(Visit(parent, call.Arguments[0]), call);
case "OrderByDescending":
return VisitOrderByDescending(Visit(parent, call.Arguments[0]), call);
case "ThenByDescending":
return VisitThenByDescending(Visit(parent, call.Arguments[0]), call);
case "Take":
return VisitTake(Visit(parent, call.Arguments[0]), call);
case "Skip":
return VisitSkip(Visit(parent, call.Arguments[0]), call);
case "First":
case "Single":
case "FirstOrDefault":
case "SingleOrDefault":
return VisitFirst(Visit(parent, call.Arguments[0]), call);
}
}
throw new NotSupportedException("Not supported expression: " + expr);
}
开发者ID:mikezhuyuan,项目名称:EQuery,代码行数:34,代码来源:QueryConverter.cs
示例13: OnChildNode
/// <inheritdoc/>
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node.NodeName.Equals("name_part")) {
node = node.ChildNodes.FirstOrDefault();
}
string text;
if (node is IdentifierNode) {
var idNode = (IdentifierNode) node;
text = idNode.Text;
} else if (node is SqlKeyNode) {
text = ((SqlKeyNode) node).Text;
if (!String.Equals(text, "*"))
throw new SqlParseException(String.Format("Invalid object name part '{0}' provided.", text));
} else {
throw new SqlParseException(String.Format("The node of type '{0}' is not allowed.", node.GetType()));
}
if (Name != null) {
Name = String.Format("{0}.{1}", Name, text);
} else {
Name = text;
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:28,代码来源:ObjectNameNode.cs
示例14: GetLimit
private void GetLimit(ISqlNode node)
{
foreach (var childNode in node.ChildNodes) {
if (childNode is IntegerLiteralNode) {
Limit = ((IntegerLiteralNode) childNode).Value;
}
}
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:DeleteStatementNode.cs
示例15: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node.NodeName.Equals("sql_expression_list")) {
Values = node.ChildNodes.OfType<IExpressionNode>();
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:InsertValueNode.cs
示例16: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is IdentifierNode) {
SchemaName = ((IdentifierNode) node).Text;
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:DropSchemaStatementNode.cs
示例17: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node.NodeName == "user_list") {
UserNames = node.FindNodes<IdentifierNode>().Select(x => x.Text);
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:DropUserStatementNode.cs
示例18: GetFromCursor
private void GetFromCursor(ISqlNode node)
{
var idNode = node.FindNode<IdentifierNode>();
if (idNode != null) {
FromCursor = true;
CursorName = idNode.Text;
}
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:DeleteStatementNode.cs
示例19: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node is ObjectNameNode) {
TypeName = ((ObjectNameNode) node).Name;
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:DropTypeStatementNode.cs
示例20: OnChildNode
protected override ISqlNode OnChildNode(ISqlNode node)
{
if (node.NodeName.Equals("insert_tuple")) {
Values = node.FindNodes<InsertValueNode>();
}
return base.OnChildNode(node);
}
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:ValuesInsertNode.cs
注:本文中的ISqlNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论