DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Statements.CreateUserStatement Class Reference
Inheritance diagram for Deveel.Data.Sql.Statements.CreateUserStatement:
Deveel.Data.Sql.Statements.SqlStatement Deveel.Data.Sql.Expressions.IPreparable Deveel.Data.Sql.Statements.IStatement Deveel.Data.Serialization.ISerializable Deveel.Data.Sql.IExecutable

Public Member Functions

 CreateUserStatement (string userName, SqlExpression password)
 
- Public Member Functions inherited from Deveel.Data.Sql.Statements.SqlStatement
ITable Execute (IRequest context)
 Prepares and evaluates this statement into a tabular result. More...
 

Protected Member Functions

override void GetData (SerializeData data)
 
override void ExecuteStatement (ExecutionContext context)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Statements.SqlStatement
 SqlStatement ()
 
 SqlStatement (ObjectData data)
 

Properties

string UserName [get, private set]
 
SqlExpression Password [get, private set]
 
- Properties inherited from Deveel.Data.Sql.Statements.SqlStatement
SqlQuery SourceQuery [get, set]
 Gets the SqlQuery that is the origin of this statement. More...
 
bool IsFromQuery [get, private set]
 Gets a boolean value indicating if this object was formed from the parsing of a SqlQuery or if it was manually created. More...
 
- Properties inherited from Deveel.Data.Sql.Statements.IStatement
SqlQuery SourceQuery [get]
 

Private Member Functions

 CreateUserStatement (ObjectData data)
 
object IPreparable. Prepare (IExpressionPreparer preparer)
 Converts the underlying value of this instance into an object that can be evaluated by an expression. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Deveel.Data.Sql.Statements.SqlStatement
static IEnumerable< SqlStatementParse (string sqlSource)
 Parses a given string into one of more statements. More...
 
static IEnumerable< SqlStatementParse (IContext context, string sqlSource)
 Parses a given string into one of more statements. More...
 
static IEnumerable< SqlStatementParse (IContext context, SqlQuery query)
 
- Package Functions inherited from Deveel.Data.Sql.Statements.SqlStatement
void SetSource (SqlQuery query)
 

Detailed Description

Definition at line 25 of file CreateUserStatement.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Statements.CreateUserStatement.CreateUserStatement ( string  userName,
SqlExpression  password 
)
inline

Definition at line 26 of file CreateUserStatement.cs.

26  {
27  if (password == null)
28  throw new ArgumentNullException("password");
29  if (String.IsNullOrEmpty(userName))
30  throw new ArgumentNullException("userName");
31 
32  UserName = userName;
33  Password = password;
34  }
A long string in the system.
Deveel.Data.Sql.Statements.CreateUserStatement.CreateUserStatement ( ObjectData  data)
inlineprivate

Definition at line 36 of file CreateUserStatement.cs.

36  {
37  UserName = data.GetString("UserName");
38  Password = data.GetValue<SqlExpression>("Password");
39  }
Defines the base class for instances that represent SQL expression tree nodes.

Member Function Documentation

override void Deveel.Data.Sql.Statements.CreateUserStatement.ExecuteStatement ( ExecutionContext  context)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Statements.SqlStatement.

Definition at line 55 of file CreateUserStatement.cs.

55  {
56  var evaluated = Password.EvaluateToConstant(context.Request, null);
57  var passwordText = evaluated.AsVarChar().Value.ToString();
58 
59  context.Request.Query.CreateUser(UserName, passwordText);
60  }
override void Deveel.Data.Sql.Statements.CreateUserStatement.GetData ( SerializeData  data)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Sql.Statements.SqlStatement.

Definition at line 45 of file CreateUserStatement.cs.

45  {
46  data.SetValue("UserName", UserName);
47  data.SetValue("Password", Password);
48  }
void SetValue(string key, Type type, object value)
object IPreparable. Deveel.Data.Sql.Statements.CreateUserStatement.Prepare ( IExpressionPreparer  preparer)
inlineprivate

Converts the underlying value of this instance into an object that can be evaluated by an expression.

Parameters
preparerThe context used to prepare this object.
Returns
Returns an object that can be evaluated by an expression.

Implements Deveel.Data.Sql.Expressions.IPreparable.

Definition at line 50 of file CreateUserStatement.cs.

50  {
51  var preparedPassword = Password.Prepare(preparer);
52  return new CreateUserStatement(UserName, preparedPassword);
53  }
virtual SqlExpression Prepare(IExpressionPreparer preparer)
CreateUserStatement(string userName, SqlExpression password)

Property Documentation

SqlExpression Deveel.Data.Sql.Statements.CreateUserStatement.Password
getprivate set

Definition at line 43 of file CreateUserStatement.cs.

string Deveel.Data.Sql.Statements.CreateUserStatement.UserName
getprivate set

Definition at line 41 of file CreateUserStatement.cs.


The documentation for this class was generated from the following file: