private void GetOrderBy(ISqlNode node) { var listNode = node.FindByName("sorted_def_list"); if (listNode != null) { OrderBy = listNode.ChildNodes.Cast<OrderByNode>(); } }
private void GetOrderBy(ISqlNode node) { var listNode = node.FindByName("sorted_def_list"); if (listNode != null) { OrderBy = listNode.ChildNodes.Cast <OrderByNode>(); } }
private void GetUserType(ISqlNode node) { IsPrimitive = false; TypeName = node.FindNode <ObjectNameNode>().Name; var optMetaList = node.FindByName("user_type_meta_opt"); if (optMetaList != null) { GetMeta(optMetaList.ChildNodes.FirstOrDefault()); } }
public static bool HasOptionalNode(this ISqlNode node, string nodeName) { var foundNode = node.FindByName(nodeName); if (foundNode == null) { return(false); } return(foundNode.ChildNodes.Any()); }
public static TNode FindNodeOf <TNode>(this ISqlNode node, string nodeName) where TNode : class, ISqlNode { var parent = node.FindByName(nodeName); if (parent == null) { return(null); } return(parent.FindNode <TNode>()); }
private void GetIsolationLevel(ISqlNode node) { var levelType = node.FindByName("level_type"); if (levelType == null) { throw new SqlParseException("Cannot find the isolation level"); } var keys = levelType.ChildNodes.OfType <SqlKeyNode>().Select(x => x.Text).ToArray(); Value = String.Join(" ", keys); }
private void GetReadAccess(ISqlNode node) { var accessType = node.FindByName("access_type"); if (accessType == null) { throw new SqlParseException("Cannot find the read access type."); } var keys = accessType.ChildNodes.OfType <SqlKeyNode>().Select(x => x.Text).ToArray(); Value = String.Join(" ", keys); }
private void GetArguments(ISqlNode node) { var listNode = node.FindByName("arg_list"); if (listNode == null) return; var args = new List<IExpressionNode>(); foreach (var childNode in listNode.ChildNodes) { if (childNode is IExpressionNode) args.Add((IExpressionNode)childNode); } Arguments = args.AsEnumerable(); }
protected override ISqlNode OnChildNode(ISqlNode node) { if (node is ObjectNameNode) { TableName = ((ObjectNameNode) node).Name; } else if (node.NodeName.Equals("insert_source")) { var colNode = node.FindByName("column_list_opt"); if (colNode != null) ColumnNames = colNode.FindNodes<IdentifierNode>().Select(x => x.Text); ValuesInsert = node.FindNode<ValuesInsertNode>(); SetInsert = node.FindNode<SetInsertNode>(); QueryInsert = node.FindNode<QueryInsertNode>(); } return base.OnChildNode(node); }
private void GetArguments(ISqlNode node) { var listNode = node.FindByName("arg_list"); if (listNode == null) { return; } var args = new List <IExpressionNode>(); foreach (var childNode in listNode.ChildNodes) { if (childNode is IExpressionNode) { args.Add((IExpressionNode)childNode); } } Arguments = args.AsEnumerable(); }
protected override ISqlNode OnChildNode(ISqlNode node) { if (node is ObjectNameNode) { TableName = ((ObjectNameNode)node).Name; } else if (node.NodeName.Equals("insert_source")) { var colNode = node.FindByName("column_list_opt"); if (colNode != null) { ColumnNames = colNode.FindNodes <IdentifierNode>().Select(x => x.Text); } ValuesInsert = node.FindNode <ValuesInsertNode>(); SetInsert = node.FindNode <SetInsertNode>(); QueryInsert = node.FindNode <QueryInsertNode>(); } return(base.OnChildNode(node)); }
private void GetUserType(ISqlNode node) { IsPrimitive = false; TypeName = node.FindNode<ObjectNameNode>().Name; var optMetaList = node.FindByName("user_type_meta_opt"); if (optMetaList != null) { GetMeta(optMetaList.ChildNodes.FirstOrDefault()); } }