|
static ITransaction | CreateTransaction (this IDatabase database, IsolationLevel isolation) |
|
static ITransaction | FindTransactionById (this IDatabase database, int commidId) |
|
static ISession | CreateUserSession (this IDatabase database, User user) |
|
static ISession | CreateUserSession (this IDatabase database, string userName, string password) |
|
static void | CreateAdminUser (this IDatabase database, IQuery context, string adminName, string adminPassword) |
|
static User | Authenticate (this IDatabase database, string username, string password) |
|
Definition at line 25 of file DatabaseExtensions.cs.
static User Deveel.Data.DatabaseExtensions.Authenticate |
( |
this IDatabase |
database, |
|
|
string |
username, |
|
|
string |
password |
|
) |
| |
|
inlinestatic |
Definition at line 120 of file DatabaseExtensions.cs.
122 using (var session = database.CreateSystemSession()) {
123 session.CurrentSchema(SystemSchema.Name);
125 using (var queryContext = session.CreateQuery()) {
126 return queryContext.Authenticate(username, password);
static void Deveel.Data.DatabaseExtensions.CreateAdminUser |
( |
this IDatabase |
database, |
|
|
IQuery |
context, |
|
|
string |
adminName, |
|
|
string |
adminPassword |
|
) |
| |
|
inlinestatic |
Definition at line 101 of file DatabaseExtensions.cs.
103 var user = context.CreateUser(adminName, adminPassword);
108 context.GrantToUserOnSchema(database.Context.DefaultSchema(), user.Name,
Privileges.SchemaAll,
true);
109 context.GrantToUserOnSchema(SystemSchema.Name, user.Name,
Privileges.SchemaRead);
112 SystemSchema.GrantToPublic(context);
113 }
catch (DatabaseSystemException) {
115 }
catch (Exception ex) {
116 throw new DatabaseSystemException(
"Could not create the database administrator.", ex);
const string SecureGroup
THe name of the secure access group.
static ISession Deveel.Data.DatabaseExtensions.CreateInitialSystemSession |
( |
this IDatabase |
database | ) |
|
|
inlinestaticpackage |
Definition at line 64 of file DatabaseExtensions.cs.
65 var transaction = database.CreateSafeTransaction(
IsolationLevel.Serializable);
66 return new SystemSession(transaction, SystemSchema.Name);
Definition at line 39 of file DatabaseExtensions.cs.
40 return database.TransactionFactory.CreateTransaction(isolation);
Definition at line 59 of file DatabaseExtensions.cs.
60 var transaction = database.CreateTransaction(isolation);
61 return new SystemSession(transaction, SystemSchema.Name);
static ISession Deveel.Data.DatabaseExtensions.CreateSystemSession |
( |
this IDatabase |
database | ) |
|
|
inlinestaticpackage |
Definition at line 28 of file DatabaseExtensions.cs.
30 throw new InvalidOperationException(
String.Format(
"Database '{0}' is not open.", database.Name));
32 return database.CreateSafeTransaction(isolation);
A long string in the system.
Definition at line 47 of file DatabaseExtensions.cs.
49 throw new ArgumentNullException(
"user");
55 var transaction = database.CreateTransaction(isolation);
56 return new Session(transaction, user);
static ISession Deveel.Data.DatabaseExtensions.CreateUserSession |
( |
this IDatabase |
database, |
|
|
string |
userName, |
|
|
string |
password |
|
) |
| |
|
inlinestatic |
Definition at line 78 of file DatabaseExtensions.cs.
79 var user = database.Authenticate(userName, password);
81 throw new InvalidOperationException(
String.Format(
"Unable to create a session for user '{0}': not authenticated.", userName));
83 return database.CreateUserSession(user);
A long string in the system.
static ITransaction Deveel.Data.DatabaseExtensions.FindTransactionById |
( |
this IDatabase |
database, |
|
|
int |
commidId |
|
) |
| |
|
inlinestatic |
Definition at line 35 of file DatabaseExtensions.cs.
36 return database.TransactionFactory.OpenTransactions.FindById(commidId);
static ISession Deveel.Data.DatabaseExtensions.OpenUserSession |
( |
this IDatabase |
database, |
|
|
int |
commitId, |
|
|
User |
user |
|
) |
| |
|
inlinestaticprivate |
Definition at line 86 of file DatabaseExtensions.cs.
88 throw new ArgumentException(
"Invalid commit reference specified.");
90 var transaction = database.FindTransactionById(commitId);
91 if (transaction == null)
92 throw new InvalidOperationException(
String.Format(
"The request transaction with ID '{0}' is not open.", commitId));
94 return new Session(transaction, user);
A long string in the system.
The documentation for this class was generated from the following file: