Class SQLDispatcher

    • Field Detail

      • plugin

        @NotNull
        protected final @NotNull ADPPlugin plugin
      • storageType

        @NotNull
        protected final @NotNull StorageType storageType
    • Constructor Detail

      • SQLDispatcher

        public SQLDispatcher()
    • Method Detail

      • isFailed

        public final boolean isFailed()
        Description copied from interface: IDatabaseDispatcher
        Is failed to start the database?
        Specified by:
        isFailed in interface IDatabaseDispatcher
        Returns:
        true if the initialization has failed
      • initConnectionFactory

        protected abstract ConnectionFactory initConnectionFactory()
        Initialize the SQL connection factory
        Returns:
        the initialized connection factory
      • prepareMigrator

        protected MigratorConfiguration prepareMigrator()
        Prepare the Migrator class
        Returns:
        the Migrator configuration
      • lookupMigrateScripts

        protected TreeSet<String> lookupMigrateScripts()
        Lookup for Migrator scripts
        Returns:
        a set of migrate scripts
      • migrateTables

        protected void migrateTables​(Migrator migrator)
        Start Migrator.migrate
        Parameters:
        migrator - the Migrator instance
      • getBackwardMigration

        protected int getBackwardMigration()
        Get the backward migration file
        Returns:
        the migration file number, -1 to disable
      • performMigration

        public void performMigration​(org.jdbi.v3.core.Handle transaction,
                                     LinkedList<String> queries,
                                     int version)
        Perform a migration in this database
        Parameters:
        transaction - the database transaction
        queries - the list of queries of the migration
        version - the version of the database