DatabaseClient extends QueryBuilderImpl implements QueryRunner { public void migrate(Action1<Connection> migrationPreparation) { Flyway flyway = getFlyway(); flyway.setCallbacks(new MigrationCallback( typeAdapter != null ? typeAdapter.createConnectionPreparer() : null, migrationPreparation)); flyway.migrate(); } DatabaseClient(DatabaseType type, DataSource dataSource);  DatabaseClient(DatabaseType type, @Named("url") String url);  DatabaseClient(@Named("url") String url);  DatabaseClient(
            DatabaseType type,
            @Named("url") String url,
            @Named("username") String username,
            @Named("password") String password);  DatabaseClient(
            @Named("url") String url,
            @Named("username") String username,
            @Named("password") String password); String getVersion(); String getURL(); void clean(); void migrate(Action1<Connection> migrationPreparation); void migrate(); @Override ResultBuilder query(String sql); @Override ResultBuilder query(String sql, Object... parameters); @Override UpdateQueryExecution update(String sql, Object... parameters); DatabaseClient changeCatalog(String catalog);  }
@Test public void migration() { DatabaseClient client = new DatabaseClient(DatabaseType.H2, "jdbc:h2:mem:test2"); client.migrate(connection -> { try { connection.prepareStatement("create table quarks(name varchar(64), spin integer)").execute(); } catch (SQLException e) { throw new RuntimeException(e); } }); Outline<Quark> outline = OutlineBuilder.DEFAULT.build(Quark.class); client.insertInto(outline).row(rb -> rb .put(outline.member(m -> m.getName()), "up") .put(outline.member(m -> m.getSpin()), 1) .build()) .count() .toBlocking() .last(); List<Quark> quarks = client.selectAll().from(outline).all().getAs(r -> outline.wrap(new Quark()) .set(p -> p.getName(), r.get(outline.member(m -> m.getName()))) .set(p -> p.getSpin(), r.get(outline.member(m -> m.getSpin()))) .get()) .toBlocking().last(); assertEquals(1, quarks.size()); assertEquals("up", quarks.get(0).getName()); assertEquals(1, quarks.get(0).getSpin()); }