private void Process(CreateUserExpression expression)
        {
            if (Exists(ExtendedGeneratorField.GenerateUserExistsSql(expression.SchemaName)))
            {
                return;
            }

            Logger.LogSay($"Creating Postgres user '{expression.SchemaName}'...");
            Debug($"Postgress-Process(CreateUserExpression): Sql={ExtendedGeneratorField.Generate(expression)}");
            Process(ExtendedGeneratorField.Generate(expression));
            Logger.LogSay($"Created Postgres user '{expression.SchemaName}'...");
        }
        private void Process(CreateUserExpression expression)
        {
            if (Exists(ExtendedGeneratorField.GenerateUserExistsSql(expression.SchemaName)))
            {
                return;
            }

            var stopwatch = new StopWatch();

            Logger.LogSay($"Creating Postgres user/role '{expression.SchemaName}'...");
            stopwatch.Time(() => Process(ExtendedGeneratorField.Generate(expression)));
            Logger.LogSay($"Created Postgres user/role '{expression.SchemaName}'...");
            Logger.LogElapsedTime(stopwatch.ElapsedTime());
        }
Beispiel #3
0
        public string Generate(CreateUserExpression expression)
        {
            var schemaPassword = expression.SchemaName;

            if (expression.SchemaName.EqualsIgnoreCase(DbMigrationConfig.Schema))
            {
                schemaPassword = DbMigrationConfig.SchemaPassword;
            }

            if (string.IsNullOrEmpty(schemaPassword))
            {
                schemaPassword = expression.SchemaName;
            }

            var sql = string.Format(CreateUserSqlTemplate, Quoter.QuoteSchemaName(expression.SchemaName), schemaPassword);

            return(sql);
        }
 public string Generate(CreateUserExpression expression)
 {
     throw new NotImplementedException();
 }