Sha256: 07af7270230fc47f54e484d1137a96a734371fe16135423545e115d083da2b68

Contents?: true

Size: 442 Bytes

Versions: 25

Compression:

Stored size: 442 Bytes

Contents

#!/usr/bin/env ruby
require 'yaml'

env = ENV["POSTJOB_ENV"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"

configs = YAML.load_file "config/database.yml"
config = configs.fetch(env) { configs.fetch("defaults") }

ENV["PGHOST"]     = config["host"]
ENV["PGPORT"]     = config["port"] && config["port"].to_s
ENV["PGUSER"]     = config["username"]
ENV["PGPASSWORD"] = config["password"]

system "psql", "-d", config.fetch("database")

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
simple-sql-0.5.8 bin/pg
simple-sql-0.5.7 bin/pg
simple-sql-0.5.6 bin/pg
simple-sql-0.5.5 bin/pg
simple-sql-0.5.4 bin/pg
simple-sql-0.5.3 bin/pg
simple-sql-0.4.41 bin/pg
simple-sql-0.5.2 bin/pg
simple-sql-0.4.40 bin/pg
simple-sql-0.4.39 bin/pg
simple-sql-0.4.38 bin/pg
simple-sql-0.4.37 bin/pg
simple-sql-0.4.36 bin/pg
simple-sql-0.4.35 bin/pg
simple-sql-0.5.0 bin/pg
simple-sql-0.4.32 bin/pg
simple-sql-0.4.31 bin/pg
simple-sql-0.4.30 bin/pg
simple-sql-0.4.29 bin/pg
simple-sql-0.4.28 bin/pg