Class YugabyteDBDatabase

java.lang.Object
org.flywaydb.core.internal.database.base.Database<org.flywaydb.database.postgresql.PostgreSQLConnection>
org.flywaydb.database.postgresql.PostgreSQLDatabase
org.flywaydb.community.database.postgresql.yugabytedb.YugabyteDBDatabase
All Implemented Interfaces:
Closeable, AutoCloseable

public class YugabyteDBDatabase extends org.flywaydb.database.postgresql.PostgreSQLDatabase
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.flywaydb.core.internal.database.base.Database

    configuration, databaseType, jdbcConnectionFactory, jdbcMetaData, jdbcTemplate, rawMainJdbcConnection, statementInterceptor
  • Constructor Summary

    Constructors
    Constructor
    Description
    YugabyteDBDatabase(org.flywaydb.core.api.configuration.Configuration configuration, org.flywaydb.core.internal.jdbc.JdbcConnectionFactory jdbcConnectionFactory, org.flywaydb.core.internal.jdbc.StatementInterceptor statementInterceptor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    ensureSupported(org.flywaydb.core.api.configuration.Configuration configuration)
     
    getRawCreateScript(org.flywaydb.core.internal.database.base.Table table, boolean baseline)
     
    boolean
     
    boolean
    YugabyteDB does not support PG Advisor Locks.

    Methods inherited from class org.flywaydb.database.postgresql.PostgreSQLDatabase

    catalogIsSchema, doGetCurrentUser, doQuote, getBooleanFalse, getBooleanTrue, getDatabaseHosting, getEscapedQuote, getSelectStatement

    Methods inherited from class org.flywaydb.core.internal.database.base.Database

    cleanPostSchemas, cleanPreSchemas, close, computeVersionDisplayName, determineVersion, disposeEventConnection, doCleanPostSchemas, doCleanPreSchemas, doGetCatalog, ensureDatabaseIsRecentEnough, ensureDatabaseNotOlderThanOtherwiseRecommendUpgradeToFlywayEdition, getAllSchemas, getBaselineStatement, getCatalog, getCloseQuote, getConfiguration, getCreateScript, getCurrentUser, getDatabaseType, getDefaultDelimiter, getDeleteStatement, getEventConnection, getInsertStatement, getInstalledBy, getJdbcMetaData, getMainConnection, getMigrationConnection, getOpenQuote, getUpdateStatement, getVersion, hasEventConnection, notifyDatabaseIsNotFormallySupported, quote, recommendFlywayUpgradeIfNecessary, recommendFlywayUpgradeIfNecessaryForMajorVersion, supportsEmptyMigrationDescription, supportsMultiStatementTransactions, unQuote

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • YugabyteDBDatabase

      public YugabyteDBDatabase(org.flywaydb.core.api.configuration.Configuration configuration, org.flywaydb.core.internal.jdbc.JdbcConnectionFactory jdbcConnectionFactory, org.flywaydb.core.internal.jdbc.StatementInterceptor statementInterceptor)
  • Method Details

    • doGetConnection

      protected YugabyteDBConnection doGetConnection(Connection connection)
      Overrides:
      doGetConnection in class org.flywaydb.database.postgresql.PostgreSQLDatabase
    • ensureSupported

      public void ensureSupported(org.flywaydb.core.api.configuration.Configuration configuration)
      Overrides:
      ensureSupported in class org.flywaydb.database.postgresql.PostgreSQLDatabase
    • supportsDdlTransactions

      public boolean supportsDdlTransactions()
      Overrides:
      supportsDdlTransactions in class org.flywaydb.database.postgresql.PostgreSQLDatabase
    • getRawCreateScript

      public String getRawCreateScript(org.flywaydb.core.internal.database.base.Table table, boolean baseline)
      Overrides:
      getRawCreateScript in class org.flywaydb.database.postgresql.PostgreSQLDatabase
    • useSingleConnection

      public boolean useSingleConnection()
      YugabyteDB does not support PG Advisor Locks. So the YugabyteDB plugin employs SELECT ... FOR UPDATE in a transaction to implement locking for Flyway operations instead of the PG Advisory locks. If a single connection is used, it may cause issues if multiple threads execute begin/commit on it for Flyway operations. Returning false from this method ensures the same connection is not used for migrations.
      Overrides:
      useSingleConnection in class org.flywaydb.database.postgresql.PostgreSQLDatabase
      Returns:
      false