public MySQLDatabaseCreator(
     [NotNull] RelationalDatabaseCreatorDependencies dependencies,
     [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder)
     : base(dependencies)
 {
     _connection               = (MySQLServerConnection)dependencies.Connection;
     _sqlGenerator             = dependencies.MigrationsSqlGenerator;
     _rawSqlCommandBuilder     = rawSqlCommandBuilder;
     _migrationCommandExecutor = dependencies.MigrationCommandExecutor;
 }
Esempio n. 2
0
        public virtual IMySQLServerConnection CreateMasterConnection()
        {
            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder(_cnnStr ?? ConnectionString);

            builder.Database = "mysql";

            var optionsBuilder = new DbContextOptionsBuilder();

            optionsBuilder.UseMySQL(builder.ConnectionString);

            MySQLServerConnection c = CreateConnection(optionsBuilder.Options);

            return(c);
        }