DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
StatementExtensions.cs
Go to the documentation of this file.
1 using System;
2 
4 
5 namespace Deveel.Data.Sql.Statements {
6  public static class StatementExtensions {
7  public static IStatement Prepare(this IStatement statement, IExpressionPreparer preparer) {
8  if (statement is IPreparable)
9  statement = ((IPreparable) statement).Prepare(preparer) as IStatement;
10 
11  return statement;
12  }
13 
14  public static IStatement PrepareStatement(this IStatement statement, IRequest context) {
15  if (statement is IPreparableStatement)
16  statement = ((IPreparableStatement) statement).Prepare(context);
17 
18  return statement;
19  }
20 
35  public static IStatement Prepare(this IStatement statement, IExpressionPreparer preparer, IRequest context) {
36  if (statement is IPreparable)
37  statement = ((IPreparable) statement).Prepare(preparer) as IStatement;
38 
39  if (statement == null)
40  return null;
41 
42  if (statement is IPreparableStatement)
43  statement = ((IPreparableStatement) statement).Prepare(context);
44 
45  return statement;
46  }
47  }
48 }
static IStatement Prepare(this IStatement statement, IExpressionPreparer preparer, IRequest context)
Prepares this statement and returns an object that can be executed within a given context...
An interface used to prepare a SqlExpression object.
static IStatement Prepare(this IStatement statement, IExpressionPreparer preparer)
static IStatement PrepareStatement(this IStatement statement, IRequest context)
A contract for objects that participate to a SqlExpression.Prepare phase of an expression evaluation...
Definition: IPreparable.cs:30