duct-framework / database.sql

Integrant methods for connecting to a SQL database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duct database.sql

Build Status

Integrant methods for connecting to a SQL database from the Duct framework.

For pooled connections, use database.sql.hikaricp.

Installation

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

[duct/database.sql "0.1.0"]

Usage

This library provides two things: a Boundary record that holds a database spec, and a multimethod for :duct.database/sql that initiates a database spec into the Boundary.

{:duct.database/sql {:connection-uri "jdbc:sqlite:db/example.sqlite"}}

When you write functions against the database, consider using a protocol and extending the Boundary record. This will allow you to easily mock or stub out the database using a tool like Shrubbery.

License

Copyright © 2017 James Reeves

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

About

Integrant methods for connecting to a SQL database


Languages

Language:Clojure 100.0%