internal static string GetSchema(this ReadOnlySettings settings)
        {
            string schema;

            if (settings.TryGet("SqlPersistence.Schema", out schema))
            {
                return(schema);
            }
            var sqlVariant = settings.GetSqlVariant();

            if (sqlVariant == Persistence.Sql.SqlVariant.MsSqlServer)
            {
                return("dbo");
            }
            return(null);
        }
示例#2
0
    public async Task Install(string identity)
    {
        var connectionBuilder = settings.GetConnectionBuilder();
        var sqlVariant        = settings.GetSqlVariant();
        var schema            = settings.GetSchema();
        var scriptDirectory   = ScriptLocation.FindScriptDirectory(sqlVariant);
        var tablePrefix       = settings.GetTablePrefix();

        ConfigValidation.ValidateTableSettings(sqlVariant, tablePrefix, schema);

        using (var connection = await connectionBuilder.OpenConnection().ConfigureAwait(false))
            using (var transaction = connection.BeginTransaction())
            {
                await InstallOutbox(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);
                await InstallSagas(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);
                await InstallSubscriptions(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);
                await InstallTimeouts(scriptDirectory, connection, transaction, tablePrefix, schema, sqlVariant).ConfigureAwait(false);

                transaction.Commit();
            }
    }