public override IMigrationProcessor Create(string connectionString, IAnnouncer announcer, IMigrationProcessorOptions options)
        {
            var factory    = new Db2DbFactory();
            var connection = factory.CreateConnection(connectionString);

            return(new Db2Processor(connection, new Db2Generator(), announcer, options, factory));
        }
 public void SetUp()
 {
     Factory = new Db2DbFactory();
     Connection = Factory.CreateConnection(IntegrationTestOptions.Db2.ConnectionString);
     Quoter = new Db2Quoter();
     Processor = new Db2Processor(Connection, new Db2Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), Factory);
     Connection.Open();
 }
Esempio n. 3
0
        public override IMigrationProcessor Create(string connectionString, IAnnouncer announcer, IMigrationProcessorOptions options)
        {
            var factory          = new Db2DbFactory(_serviceProvider);
            var connection       = factory.CreateConnection(connectionString);
            var generatorOptions = new OptionsWrapper <GeneratorOptions>(new GeneratorOptions());

            return(new Db2Processor(connection, new Db2Generator(new Db2Quoter(), generatorOptions), announcer, options, factory));
        }
Esempio n. 4
0
 public Db2Processor(
     [NotNull] Db2DbFactory factory,
     [NotNull] Db2Generator generator,
     [NotNull] Db2Quoter quoter,
     [NotNull] ILogger <Db2Processor> logger,
     [NotNull] IOptionsSnapshot <ProcessorOptions> options,
     [NotNull] IConnectionStringAccessor connectionStringAccessor)
     : base(() => factory.Factory, generator, logger, options.Value, connectionStringAccessor)
 {
     Quoter = quoter;
 }
Esempio n. 5
0
        public Db2TestTable(string table, Db2Processor processor, string schema, params string[] columnDefinitions)
        {
            Connection = processor.Connection;
            Transaction = processor.Transaction;
            Processor = processor;
            Factory = new Db2DbFactory();
            _schema = schema;

            if (Connection.State != ConnectionState.Open)
                Connection.Open();

            Name = quoter.UnQuote(table);
            NameWithSchema = !string.IsNullOrEmpty(_schema) ? string.Format("{0}.{1}", quoter.QuoteSchemaName(_schema), quoter.QuoteTableName(Name)) : quoter.QuoteTableName(Name);
            Create(columnDefinitions);
        }
 public override IMigrationProcessor Create(string connectionString, IAnnouncer announcer, IMigrationProcessorOptions options)
 {
     var factory = new Db2DbFactory();
     var connection = (DbConnection)factory.CreateConnection(connectionString);
     return new Db2Processor(connection, new Db2Generator(), announcer, options, factory);
 }