Contains all options available when altering a database schema.
Exemplo n.º 1
0
        protected DbAlterer(string connectionString, DbPlatform dbPlatform, DbAltererOptions options)
        {
            if (connectionString == null) throw new ArgumentNullException("connectionString");
            if (dbPlatform == null) throw new ArgumentNullException("dbPlatform");
            if (connectionString == null) throw new ArgumentNullException("connectionString");

            Configuration = CreateRuntimeConfiguration(connectionString, dbPlatform, options);
        }
Exemplo n.º 2
0
        private RuntimeConfiguration CreateRuntimeConfiguration(string connectionString, DbPlatform dbPlatform, DbAltererOptions options)
        {
            var providerLocator = new ProviderLocator(new ProviderFactory()); // CLEAN: use DI container

            var providerInfo = providerLocator.GetLatest(dbPlatform);
            var validatorFactory = new ValidatorFactory(providerInfo, options, providerLocator);
            var validator = validatorFactory.Create();
            var connectionInfo = new ConnectionInfo(connectionString, providerInfo.Metadata.InvariantName, providerInfo.Metadata.SupportsTransactions, providerInfo.Metadata.EnableAnsiQuotesCommand);
            var sqlDispatcher = new SqlDispatcher(options.GetScriptingOptions(), providerInfo.Provider, providerInfo.Metadata);
            return new RuntimeConfiguration(providerInfo, connectionInfo, validator, sqlDispatcher);
        }
Exemplo n.º 3
0
        protected DbAlterer(string connectionString, DbPlatform dbPlatform, DbAltererOptions options)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException("connectionString");
            }
            if (dbPlatform == null)
            {
                throw new ArgumentNullException("dbPlatform");
            }
            if (connectionString == null)
            {
                throw new ArgumentNullException("connectionString");
            }

            Configuration = CreateRuntimeConfiguration(connectionString, dbPlatform, options);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of <see cref="DbSchema"/>.
 /// </summary>
 /// <param name="connectionString"></param>
 /// <param name="dbPlatform"></param>
 /// <param name="options"></param>
 public DbSchema(string connectionString, DbPlatform dbPlatform, DbAltererOptions options)
     : base(connectionString, dbPlatform, options)
 {
 }
Exemplo n.º 5
0
        private RuntimeConfiguration CreateRuntimeConfiguration(string connectionString, DbPlatform dbPlatform, DbAltererOptions options)
        {
            var providerLocator = new ProviderLocator(new ProviderFactory()); // CLEAN: use DI container

            var providerInfo     = providerLocator.GetLatest(dbPlatform);
            var validatorFactory = new ValidatorFactory(providerInfo, options, providerLocator);
            var validator        = validatorFactory.Create();
            var connectionInfo   = new ConnectionInfo(connectionString, providerInfo.Metadata.InvariantName, providerInfo.Metadata.SupportsTransactions, providerInfo.Metadata.EnableAnsiQuotesCommand);
            var sqlDispatcher    = new SqlDispatcher(options.GetScriptingOptions(), providerInfo.Provider, providerInfo.Metadata);

            return(new RuntimeConfiguration(providerInfo, connectionInfo, validator, sqlDispatcher));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of <see cref="DbSchema"/>.
 /// </summary>
 /// <param name="connectionString"></param>
 /// <param name="dbPlatform"></param>
 /// <param name="options"></param>
 public DbSchema(string connectionString, DbPlatform dbPlatform, DbAltererOptions options)
     : base(connectionString, dbPlatform, options)
 {
 }