You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document the supported Liquibase bootstrap for jdbc:libsql: URLs #262
Document, and cover with a test, how to point Liquibase at a jdbc:libsql:http(s)://... URL: pass the driver class explicitly (io.github.magnusp.libsql.jdbc.LibsqlDriver) or hand Liquibase a DataSource.
Why
Liquibase resolves a JDBC driver class from the URL before it opens a connection. DatabaseFactory.findDefaultDriver only consults registered liquibase.database.Database implementations, and SQLiteDatabase.getDefaultDriver claims only:
jdbc:sqlite: -> org.sqlite.JDBC
So:
DatabaseFactory.openDatabase("jdbc:libsql:http://...") fails with Driver class was not specified and could not be determined from the url (jdbc:libsql:...).
The jdbc:sqlite: alias resolves to xerial's driver class, which is not on the classpath (and would open a local file, not sqld).
This is not fixable inside the driver, because Liquibase never asks DriverManager which driver accepts the URL. It is a configuration and documentation gap. Pinned by LiquibaseIT#databaseFactoryCannotResolveALibsqlUrlToADriver in #257.
Workarounds that work today
API: new JdbcConnection(DriverManager.getConnection(url)) plus new SQLiteDatabase(). The SQLiteDatabase part disappears once the product-name issue is fixed.
Liquibase Maven plugin or liquibase.properties: set the driver class, driver=io.github.magnusp.libsql.jdbc.LibsqlDriver.
Spring Boot or any pool: pass a DataSource and set spring.datasource.driver-class-name=io.github.magnusp.libsql.jdbc.LibsqlDriver.
Where
Add a Liquibase section to docs/ (or extend README.md) with the three configurations above.
Activity
test(jdbc): add Liquibase integration smoke tests (#257)
docs: document the Liquibase bootstrap for libSQL (#269)