GithubHelp home page GithubHelp logo

leourbina / lein-postgres Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whostolebenfrog/lein-postgres

0.0 2.0 1.0 11 KB

Lein plugin to embed postgres

License: Eclipse Public License 1.0

Clojure 85.04% Shell 14.96%

lein-postgres's Introduction

lein-postgres

A lein plugin that starts up an "embedded" postgres instance to be used when running tests / during development.

In effect it works as a wrapper around OpenTable's embedded postgres JUnit helper.

Usage

Add [lein-postgres "0.1.1"] to the plugins vector in your project.clj file.

A postgres instance can then be started with lein postgres

This will start a postgres instance and wait until you send it kill command with ctrl+c

You can also start a postgres instance and run other lein tasks by passing them as a second argument.

lein postgres test

This will start postgres, run your tests (which presumably depend on postgres) before closing postgres and cleaning up.

Config

You can configure lein-postgres with a config map in your project.clj

(defproject  "1.0.0-SNAPSHOT"
  :plugins [[lein-postgres "0.1.1"]]
  :postgres {:port 12345 ;optional, defaults to a random free port
             :clean-data-directory true ;optional, defaults to true - should we cleanup the data directory on close
             :data-directory "/tmp/embeddedpostgres" ;optional, sets the temporary data directory
             :server-config {:max_connections "300"}} ;optional, allows you to set additional server config options

See here for more information on additional server-config options.

Thanks

Thanks to OpenTable for the excellent embedded postgres plugin and Joe Littlejohn for lein-embongo which was used as a base for some of the code here.

License

Copyright © 2015 Ben Griffiths

Distributed under the Eclipse Public License - just like Clojure.

lein-postgres's People

Contributors

leourbina avatar whostolebenfrog avatar

Watchers

 avatar  avatar

Forkers

henglabs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.