Leiningen plugin for executing SQL tasks.
Use this for user-level plugins:
Put [lein-sql "0.1.0-SNAPSHOT"]
into the :plugins
vector of your
:user
profile, or if you are on Leiningen 1.x do lein plugin install lein-sql 0.1.0
.
Use this for project-level plugins:
Put [lein-sql "0.1.0-SNAPSHOT"]
into the :plugins
vector of your project.clj.
To execute a query:
$ lein sql execute :driver org.postgresql.Driver \
:connection-uri jdbc:postgresql://localhost/ \
:username postgres :password postgres \
:query "CREATE DATABASE my_db"`
To run set of .sql
files:
$ lein sql execute :driver org.postgresql.Driver \
:connection-uri jdbc:postgresql://localhost/ \
:username postgres :password postgres \
:directory foo/bar
:includes **/*.sql
:excludes **/templates/**/*.sql
Copyright © 2013 Alexey Hanin
Distributed under the Eclipse Public License, the same as Clojure.