Environment URL Setting
Published 15 January 2025
Description
The jdbc url to use to connect to the database.
Note: Only certain jdbc drivers are packaged with flyway. If your driver is not packaged, then you need to ensure it is available on the classpath (see Adding to the classpath).
Type
String
Default
none - this is required
Usage
Flyway Desktop
This can be set from the connection dialog.
Command-line
./flyway -url=jdbc:h2:mem:flyway_db info
To configure a named environment via command line when using a TOML configuration, prefix url
with
environments.{environment name}.
for example:
./flyway -environments.sample.url=jdbc:h2:mem:flyway_db info
TOML Configuration File
[environments.default]
url = "jdbc:h2:mem:flyway_db"
Configuration File
flyway.url=jdbc:h2:mem:flyway_db
Environment Variable
FLYWAY_URL=jdbc:h2:mem:flyway_db
API
When using the Java API, you configure your JDBC URL, User and Password via a datasource.
Flyway.configure()
.datasource("jdbc:h2:mem:flyway_db", "myuser", "mysecretpassword")
.load()
Gradle
flyway {
url = 'jdbc:h2:mem:flyway_db'
}
Maven
<configuration>
<url>jdbc:h2:file:./target/foobar</url>
</configuration>