3using System.Threading.Tasks;
21 private readonly XmlDocument xmlDocument;
22 private readonly XmlNode xmlNode;
24 private readonly
string name;
25 private readonly
string alias;
36 this.xmlDocument = Xml;
52 this.xmlDocument =
null;
71 KeyValuePair<VariableReference, bool>[] Order,
ScriptNode Node)
74 if (WhereXPath is
null && !(Where is
null))
75 throw new ScriptRuntimeException(
"WHERE clause must use an XPATH expression when selecting nodes from XML.", Where);
79 if (WhereXPath is
null)
80 Obj =
new ObjectValue(this.xmlDocument ?? this.xmlNode);
92 Vector = Operators.Vectors.VectorDefinition.
Encapsulate(
new IElement[] { Obj },
false, Node);
115 if (WhereXPath is
null && !(Where is
null))
116 throw new ScriptRuntimeException(
"WHERE clause must use an XPATH expression when selecting nodes from XML.", Where);
120 if (WhereXPath is
null)
121 Obj =
new ObjectValue(this.xmlDocument ?? this.xmlNode);
129 Vector = Operators.Vectors.VectorDefinition.
Encapsulate(
new IElement[] { Obj },
false, Node);
139 public Task
Update(
bool Lazy, IEnumerable<object> Objects)
141 return Task.CompletedTask;
144 private Exception InvalidOperation()
161 KeyValuePair<VariableReference, bool>[] Order,
ScriptNode Node)
163 throw this.InvalidOperation();
171 public Task
Insert(
bool Lazy,
object Object)
173 throw this.InvalidOperation();
197 get =>
string.IsNullOrEmpty(this.alias) ? this.name : this.alias;
208 string.Compare(this.name,
Name,
true) == 0 ||
209 string.Compare(this.alias,
Name,
true) == 0;
219 return Task.FromResult(
false);
229 throw this.InvalidOperation();
239 throw this.InvalidOperation();
247 throw this.InvalidOperation();
Script runtime exception.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
Base class for all nodes in a parsed script tree.
Node repesenting an XPath expression
override IElement Evaluate(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
override Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the node, using the variables provided in the Variables collection.
Data Source defined by a vector.
Task< IResultSetEnumerator > Find(int Offset, int Top, bool Generic, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Finds objects matching filter conditions in Where .
Task< bool > Process(IProcessor< object > Processor, int Offset, int Top, bool Generic, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Processes objects matching filter conditions in Where .
Data Source defined by XML.
Task< int?> Delete(bool Lazy, int Offset, int Top, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Deletes a set of objects.
string Name
Collection name or alias.
Task< bool > DropIndex(string Name)
Drops an index from the source.
Task Update(bool Lazy, IEnumerable< object > Objects)
Updates a set of objects.
string TypeName
Name of corresponding type.
Task Insert(bool Lazy, object Object)
Inserts an object.
Task DropCollection()
Drops the collection specified by the source.
Task< bool > IsLabel(string Label)
Checks if the label is a label in the source.
XmlSource(string Name, string Alias, XmlDocument Xml, ScriptNode Node)
Data Source defined by XML.
Task CreateIndex(string Name, string[] Fields)
Creates an index in the source.
async Task< IResultSetEnumerator > Find(int Offset, int Top, bool Generic, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Finds objects matching filter conditions in Where .
bool IsSource(string Name)
Checks if the name refers to the source.
string CollectionName
Name of corresponding collection.
XmlSource(string Name, string Alias, XmlNode Xml, ScriptNode Node)
Data Source defined by XML.
async Task< bool > Process(IProcessor< object > Processor, int Offset, int Top, bool Generic, ScriptNode Where, Variables Variables, KeyValuePair< VariableReference, bool >[] Order, ScriptNode Node)
Processes objects matching filter conditions in Where .
Interface for processors of objects.
Basic interface for all types of elements.
IElement Encapsulate(ChunkedList< IElement > Elements, ScriptNode Node)
Encapsulates a set of elements into a similar structure as that provided by the current element.
Basic interface for vectors.
Interface for data sources that can be used in SQL statements.