Skip to content

reborg/lein-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lein-db

A Leiningen plugin to manage common project database tasks, such as dropping tables, migrations or seeding data. No implementation is provided for migrations or seed data at this time, just the infrastructure to call those tasks from leiningen. I'm planning to expand the plugin to also provide those features at some point. If you need a complete solution, please have a look at Drift: https://github.com/macourtney/drift

Usage

Add [lein-db "0.1.0"] into the :plugins vector of your project.clj. Add a leindb.clj file at the root of your classpath. The content of leindb.clj should look like this:

(ns leindb)

(defn drop-tables [])
(defn migrate [])
(defn seed [])

provide the implementation for the three functions migrate, drop-tables and seed. Then invoke them from the command line like this:

$ lein db               # With no arguments, execute migrate, drop-tables, seed in a sequence
$ lein db drop-tables      # Executes drop-tables
$ lein db migrate          # Executes migrate
$ lein db seed             # Executes seed

License

Copyright © 2012 Reborg

Distributed under the Eclipse Public License, the same as Clojure.

About

Leiningen plugin to automate the project database setup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published