Skip to content

bootique/bootique-jooq

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

build test deploy Maven Central

bootique-jooq

Integration of Jooq SQL builder with Bootique. See usage example bootique-jooq-demo.

Usage

Include bootique-jooq:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.bootique.bom</groupId>
            <artifactId>bootique-bom</artifactId>
            <version>2.0.1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

...

<dependency>
	<groupId>io.bootique.jooq</groupId>
	<artifactId>bootique-jooq</artifactId>
</dependency>

Do whatever Jooq class generation is required (for now outside of bootique-jooq scope).

Create configuration with DB connection information and optional Jooq settings:

jdbc:
  default:
      url: "jdbc:postgresql://192.168.99.100:5432/scheduling"
      initialSize: 1
      username: postgres
      password: postgres

jooq:
  dialect: POSTGRES
  executeLogging: true

Inject JooqFactory and start using Jooq:

@Inject
private JooqFactory jooqFactory;

public void doSomething() {
	try (DSLContext c = jooqFactory.newContext()) {
	    Record r = c.select().from(Tables.MY_TABLE).fetchOne();
	}
}

About

Jooq SQL runner integration with Bootique

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages