Repository navigation
test(jdbc): add Liquibase integration smoke tests - #257
Merged
Merged
Conversation
Drive the driver through Liquibase update, validate, snapshot-based table rebuilds, rollback, changeLogSync and typed inserts against a real sqld container. Pin two bootstrapping gaps discovered by the prototype: SQLiteDatabase.isCorrectDatabaseImplementation requires the product name to be exactly SQLite, and Liquibase cannot derive a driver class from a jdbc:libsql: URL.
This was referenced Oct 30, 2026
Owner
Author
# Conflicts: # libsql-jdbc/pom.xml # pom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds Liquibase integration tests to
libsql-jdbc, derived from a throwaway prototype and then pulled up into the module.The tests drive the in-tree driver through Liquibase's update, validate, snapshot-driven table rebuild, rollback,
changeLogSyncand typed-insert paths against a realsqldcontainer. They live underio.github.magnusp.libsql.jdbc.liquibaseand run under Failsafe (*IT), so./mvnw teststays Docker-free.No tracking issue; this is the test half of a driver-compatibility probe.
Driver gaps the prototype found
getDatabaseProductName()returnsSQLite (libSQL), whileSQLiteDatabase.isCorrectDatabaseImplementationrequires exactlySQLite(equalsIgnoreCase). Liquibase falls back toUnsupportedDatabaseand emitsINT GENERATED BY DEFAULT AS IDENTITY ..., which sqld rejects. Returning exactlySQLiteand keeping the libSQL identity ingetDriverName()would close this. Pinned bydatabaseFactoryFallsBackToUnsupportedDatabase(); the working tests constructSQLiteDatabaseexplicitly until then.jdbc:libsql:is not resolvable through Liquibase's URL path.DatabaseFactory.openDatabase(...)cannot derive a driver class because Liquibase's SQLite handler only claimsjdbc:sqlite:. Applications must setdriver=io.github.magnusp.libsql.jdbc.LibsqlDriveror pass aDataSource. Pinned bydatabaseFactoryCannotResolveALibsqlUrlToADriver().Separately, Liquibase 5.0.3's SQLite
dropColumnis broken (the single-column form fails validation and the nested form rebuilds without dropping the column), so the changelogs avoid it.What is covered
validate()getImportedKeysround-triprollback(N)in reverse orderchangeLogSynclibsql-jdbc/pom.xmlnow copies the shared Docker config totarget/docker-configand setsDOCKER_CONFIGfor the Failsafe fork, so the sandbox workaround is part of the build rather than a shell preamble.Type of Change
Checklist
./mvnw spotless:check)../mvnw -pl libsql-jdbc -am verify).Verification
LiquibaseIT: 8 tests, 0 failures./mvnw spotless:check: passingThe integration tests start the pinned
ghcr.io/tursodatabase/libsql-serverimage and do not require a pre-existing sqld.Tracked gaps
SQLitefor dialect detectionjdbc:libsql:; document explicit driver/DataSource setup