Liking cljdoc? Tell your friends :D

Duct module.sql

A Duct module that adds Integrant keys for a hikari-cp SQL database connection pool and Ragtime migrations to a configuration.

Installation

To install, add the following to your project :dependencies:

[duct/module.sql "0.6.1"]

Usage

To add this module to your configuration, add the :duct.module/sql key to your config.edn file:

:duct.module/sql {}

Optional Module Parameters

:database-url STRING

JDBC URL for the connection pool. Overridden by JDBC_DATABASE_URL, DATABASE_URL environment variables or custom :duct.database/sql integrant key.

Integrant Keys

When prepped, the module will compile the following Integrant keys into your config:

:duct.database.sql/hikaricp {
    :jdbc-url URL
    :logger #ig/ref :duct/logger
}

:duct.migrator/ragtime {
    :database #ig/ref :duct.database/sql
    :strategy STRATEGY
    :logger #ig/ref :duct/logger
    :migrations []
}

These defaults can be (selectively) overridden through custom :duct.database/sql (or :duct.database.sql/hikaricp) and :duct.migrator/ragtime keys in your duct profiles.

URL is either overridden, set by the :database-url module parameter or provided by the JDBC_DATABASE_URL and DATABASE_URL environment variables, in this order.

STRATEGY is :raise-error for :production environment, :rebase for :development.

Key Documentation:

License

Copyright © 2020 James Reeves

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation? These fine people already did:
James Reeves, Shkodran Gerguri & Jonas Enlund
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close