PSQL Toys

Gem GitHub Actions Workflow Status Codecov branch Depfu Inline docs License

Toys template for actions with PostgreSQL, like dumps.

Installation

Add this line to your application's Gemfile:

gem 'psql_toys'

And then execute:

bundle install

Or install it yourself as:

gem install psql_toys

Usage

application_proc = proc do
  require "#{context_directory}/application"
  MyProject::Application
end

require 'psql_toys'
expand PSQLToys::Template,
  db_config_proc: proc { application_proc.call.config[:database] },
  db_connection_proc: proc { application_proc.call.db_connection },
  db_extensions: %w[citext pgcrypto] # this is default, can be changed

# `database` namespace created
# aliases are optional, but handful
alias_tool :db, :database

db_config must have :database key, and my have :host, :port, :user, :superuser (for database and user creation) and :password keys.

Development

After checking out the repo, run bundle install to install dependencies.

Then, run toys rspec to run the tests.

To install this gem onto your local machine, run toys gem install.

To release a new version, run toys gem release %version%. See how it works here.

Contributing

Bug reports and pull requests are welcome on GitHub.

License

The gem is available as open source under the terms of the MIT License.