Exemplo n.º 1
0
    Task InstallSubscriptions(string scriptDirectory, DbConnection connection, DbTransaction transaction, string tablePrefix, string schema, SqlVariant sqlVariant)
    {
        if (!settings.ShouldInstall <StorageType.Subscriptions>())
        {
            return(Task.FromResult(0));
        }

        var createScript = Path.Combine(scriptDirectory, "Subscription_Create.sql");

        ScriptLocation.ValidateScriptExists(createScript);
        log.Info($"Executing '{createScript}'");
        if (sqlVariant == SqlVariant.Oracle)
        {
            return(connection.ExecuteTableCommand(
                       transaction: transaction,
                       script: File.ReadAllText(createScript),
                       tablePrefix: tablePrefix));
        }
        else
        {
            return(connection.ExecuteTableCommand(
                       transaction: transaction,
                       script: File.ReadAllText(createScript),
                       tablePrefix: tablePrefix,
                       schema: schema));
        }
    }
        static Task InstallSubscriptions(string scriptDirectory, DbConnection connection, DbTransaction transaction, string tablePrefix, SqlDialect sqlDialect)
        {
            var createScript = Path.Combine(scriptDirectory, "Subscription_Create.sql");

            ScriptLocation.ValidateScriptExists(createScript);
            log.Info($"Executing '{createScript}'");

            return(sqlDialect.ExecuteTableCommand(
                       connection: connection,
                       transaction: transaction,
                       script: File.ReadAllText(createScript),
                       tablePrefix: tablePrefix));
        }
Exemplo n.º 3
0
    Task InstallTimeouts(string scriptDirectory, DbConnection connection, DbTransaction transaction, string tablePrefix, SqlDialect sqlDialect)
    {
        if (!settings.IsFeatureActive(typeof(SqlTimeoutFeature)))
        {
            return(Task.FromResult(0));
        }

        var createScript = Path.Combine(scriptDirectory, "Timeout_Create.sql");

        ScriptLocation.ValidateScriptExists(createScript);
        log.Info($"Executing '{createScript}'");

        return(sqlDialect.ExecuteTableCommand(
                   connection: connection,
                   transaction: transaction,
                   script: File.ReadAllText(createScript),
                   tablePrefix: tablePrefix));
    }