Last active
November 26, 2023 17:20
-
-
Save alexanderankin/1131c5db52311f5a990de59f7499888a to your computer and use it in GitHub Desktop.
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
package org.example.jooq.sb.generator; | |
import liquibase.Contexts; | |
import liquibase.Liquibase; | |
import liquibase.database.DatabaseFactory; | |
import liquibase.database.jvm.JdbcConnection; | |
import liquibase.resource.ClassLoaderResourceAccessor; | |
import java.io.OutputStreamWriter; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
public class Reproducer { | |
// docker run --rm -it --name repro -p 127.0.0.1:5432:5432 -e POSTGRES_HOST_AUTH_METHOD=trust -e POSTGRES_DB=liquibase_debugging -e POSTGRES_USER=root postgres:16-alpine | |
@lombok.SneakyThrows | |
public static void main(String[] args) { | |
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost/liquibase_debugging", "root", "root")) { | |
connection.createStatement().execute("set log_statement = 'all'"); | |
Liquibase liquibase = new Liquibase("/db/changelog/db.changelog-master.yaml", | |
new ClassLoaderResourceAccessor(), | |
DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection))); | |
liquibase.update((Contexts) null, new OutputStreamWriter(System.out)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
solution, use the spring integration - liquibase/liquibase#4708