Easily manipulate Postgres schemas in Sequel.
Add this line to your application's Gemfile:
gem 'sequel-postgres-schemata'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sequel-postgres-schemata
Sequel.extension :postgres_schemata
db = Sequel.connect adapter: 'postgres', search_path: %w(foo public)
db.create_schema :bar
db.search_path # => [:foo, :public]
db.search_path :baz do
db.search_path # => [:baz]
end
db.search_path :baz, prepend: true do
db.search_path # => [:baz, :foo, :public]
end
db.schemata # => [:pg_toast, :pg_temp_1, :pg_toast_temp_1, :pg_catalog, :public, :information_schema, :bar]
db.current_schemata # => [:public]
db.search_path = [:bar, :foo, :public]
db.current_schemata # => [:bar, :public]
db.rename_schema :bar, :foo
db.current_schemata # => [:foo, :public]
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request