DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
QueryExtensions.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2015 Deveel
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 using System;
18 
20 using Deveel.Data.Types;
21 
22 namespace Deveel.Data.Sql.Variables {
23  public static class QueryExtensions {
24  public static Variable DeclareVariable(this IQuery query, VariableInfo variableInfo) {
25  return query.Context.DeclareVariable(variableInfo);
26  }
27 
28  public static void DropVariable(this IQuery query, string variableName) {
29  query.Context.DropVariable(variableName);
30  }
31 
32  public static Variable SetVariable(this IQuery query, string variableName, SqlExpression value) {
33  return query.Context.SetVariable(variableName, value);
34  }
35 
36  public static Variable FindVariable(this IQuery query, string variableName) {
37  return query.Context.FindVariable(variableName);
38  }
39 
40  public static Variable DeclareVariable(this IQuery query, string variableName, SqlType variableType) {
41  return DeclareVariable(query, variableName, variableType, false);
42  }
43 
44  public static Variable DeclareVariable(this IQuery query, string variableName, SqlType variableType, bool constant) {
45  return query.DeclareVariable(new VariableInfo(variableName, variableType, constant));
46  }
47  }
48 }
static void DropVariable(this IQuery query, string variableName)
static Variable SetVariable(this IQuery query, string variableName, SqlExpression value)
static Variable DeclareVariable(this IQuery query, string variableName, SqlType variableType, bool constant)
Defines the properties of a specific SQL Type and handles the values compatible.
Definition: SqlType.cs:33
static Variable FindVariable(this IQuery query, string variableName)
static Variable DeclareVariable(this IQuery query, string variableName, SqlType variableType)
Defines the base class for instances that represent SQL expression tree nodes.
static Variable DeclareVariable(this IQuery query, VariableInfo variableInfo)
new IQueryContext Context
Definition: IQuery.cs:21