Skip to content

Document the supported Liquibase bootstrap for jdbc:libsql: URLs #262

Closed

Description

@magnusp

Goal

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

Verification

  • The documented snippets run against the pinned sqld container.
  • ./mvnw -pl libsql-jdbc -am verify -Dit.test=LiquibaseIT
  • ./mvnw spotless:check

Found while adding the Liquibase integration tests in #257.

Activity

  1. added
    documentationImprovements or additions to documentation
    P2Normal priority: edge case, feature gap, or test/process improvement
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 31, 2026
    161af09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority: edge case, feature gap, or test/process improvementdocumentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions