Exemplo n.º 1
0
 public override void CreateDatabase(IDbCodeConnection connection, string databaseName, string owner)
 {
     using (var cmd = connection.CreateCommand()) {
         var context = new ElementCode();
         context.Add(SqlKeyword.CreateDatabase);
         context.Concat(Quote(databaseName));
         context.Add(SqlKeyword.Owner);
         context.Concat(Quote(owner));
         context.Go();
         context.Build().Execute(cmd);
     }
 }
Exemplo n.º 2
0
 public override void CreateRole(IDbCodeConnection connection, string roleName, string password)
 {
     using (var cmd = connection.CreateCommand()) {
         var context = new ElementCode();
         context.Add(SqlKeyword.CreateRole);
         context.Concat(Quote(roleName));
         context.Add(SqlKeyword.Password);
         context.Concat(string.Concat("'", password, "'"));
         context.Concat("LOGIN");
         context.Go();
         context.Build().Execute(cmd);
     }
 }