Project

pasqual

0.0
No commit activity in last 3 years
No release in over 3 years
Shortcuts for postgres commands, with option to use ENV-configured conenction URLs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 10.0
~> 3.0.0

Runtime

~> 0.5
 Project Readme

Pasqual

Run Postgres CLI commands with the help of database settings configured with environment variables.

Installation

Add this line to your application's Gemfile:

gem 'pasqual'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pasqual

Usage

First, get an instance of Pasqual:

psql = Pasqual.for ENV['DATABASE_URL']

createdb

Createdb automatically uses the database name defined in ENV.

psql.createdb

A custom name can optionally be specified:

psql.createdb 'foodb'

dropdb

Dropdb automatically uses the database name defined in ENV.

psql.dropdb

A custom name can optionally be specified:

psql.dropdb 'foodb'

command

Executes an SQL script, the same as piping text into the psql command.

psql.command "SELECT * from users;"

pipe

You can pipe a file into the psql command:

psql.pipe_sql '/path/to/file.sql'

Contributing

  1. Fork it ( https://github.com/[my-github-username]/pasqual/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request