20 using NUnit.Framework;
22 namespace Deveel.Data.Sql.Statements {
26 var query = base.CreateQuery(session);
27 query.CreateUser(
"test_user",
"12345");
33 const string sql =
"GRANT SELECT, DELETE, UPDATE PRIVILEGE ON test_table TO test_user";
36 Assert.IsNotNull(statements);
37 Assert.IsNotEmpty(statements);
38 Assert.AreEqual(3, statements.Count());
44 Assert.AreEqual(
Privileges.Select, first.Privilege);
45 Assert.AreEqual(
"test_user", first.Grantee);
46 Assert.AreEqual(
"test_table", first.ObjectName.ToString());
51 const string sql =
"GRANT admin, data_reader TO test_user";
54 Assert.IsNotNull(statements);
55 Assert.IsNotEmpty(statements);
56 Assert.AreEqual(2, statements.Count());
61 Assert.AreEqual(
"admin", first.Role);
62 Assert.AreEqual(
"test_user", first.UserName);
void ParseGrantRolesToOneUser()
Represents the foundation class of SQL statements to be executed.
An isolated session to a given database for a given user, encapsulating the transaction for operation...
override IQuery CreateQuery(ISession session)
static IEnumerable< SqlStatement > Parse(string sqlSource)
Parses a given string into one of more statements.
void ParseGrantToOneUserToOneTable()