Skip to content

Vert.x ext that provides a HSQL connector compatible with JOOQ

Notifications You must be signed in to change notification settings

mahieddine/vertx-hsql-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vert.x HSQL Client

Build Status MIT license Maintenance

HSQL Client is a Vert.x ext that provides a HSQL connector compatible with jooq, it expose the native SQL.Connection interface rather than the Vertx' own SQLConnection

Maven

<dependency>
  <groupId>io.github.mahieddine</groupId>
  <artifactId>vertx-hsql-client</artifactId>
  <version>3.4.2</version>
</dependency>

Usage

# Init HSQL Connection
HSQLClient hsqlClient = HSQLClient.createShared(vertx, new JsonObject()
                .put("url", DATABASE_URL)
                .put("username", DATABASE_USERNAME)
                .put("password", DATABASE_PASSWORD)
);
Configuration jooqConf = new DefaultConfiguration().set(SQLDialect.HSQLDB);
...

# Retrieve a connection handler
hsqlClient.getConnection(connectionAsyncResult -> {
                if (connectionAsyncResult.succeeded()) {
                    jooqConf.set(connectionAsyncResult.result());
                    cf.complete(null);
                } else {
                    cf.completeExceptionally(connectionAsyncResult.cause());
                }
});

# After that you can use the jooqConf object to init your JOOQ DAO and perform your requests normally :) 

About

Vert.x ext that provides a HSQL connector compatible with JOOQ

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages