21 using NUnit.Framework;
23 namespace Deveel.Data.Sql {
26 private const string TestUserName =
"test";
27 private const string TestPassword =
"abc1234";
30 using (var session = database.CreateUserSession(AdminUserName, AdminPassword)) {
31 using (var query = session.CreateQuery()) {
32 if (TestContext.CurrentContext.Test.Name.Equals(
"CreateSimple_RegularUser")) {
33 var user = query.CreateUser(TestUserName, TestPassword);
35 query.GrantToUserOnSchema(
"APP", user.Name,
Privileges.Create);
41 return base.CreateAdminSession(database);
51 using (var session = CreateUserSession(AdminUserName, AdminPassword)) {
52 using (var query = session.CreateQuery()) {
53 Assert.DoesNotThrow(() => query.CreateTable(tableInfo));
54 Assert.DoesNotThrow(() => query.Commit());
58 using (var session = CreateUserSession(AdminUserName, AdminPassword)) {
59 using (var query = session.CreateQuery()) {
61 Assert.DoesNotThrow(() => exists = query.TableExists(tableName));
62 Assert.IsTrue(exists);
74 using (var session = CreateUserSession(TestUserName, TestPassword)) {
75 using (var query = session.CreateQuery()) {
76 Assert.DoesNotThrow(() => query.CreateTable(tableInfo));
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static ObjectName Parse(string s)
Parses the given string into a ObjectName object.
void CreateSimpleTableAsAdmin_NewSession()
void Commit()
Commits the latest changes made by the user in the session.
static NumericType Integer()
Describes the name of an object within a database.
The representation of a single database in the system.
void CreateSimple_RegularUser()
An isolated session to a given database for a given user, encapsulating the transaction for operation...
override ISession CreateAdminSession(IDatabase database)
static StringType String()
Defines the metadata properties of a table existing within a database.