0.02
Low commit activity in last 3 years
No release in over a year
Postgres database as a backend for Refile. Uses "Large Objects". See https://www.postgresql.org/docs/current/largeobjects.html for more info.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Runtime

>= 0
>= 0.6, < 0.8
 Project Readme

Refile::Postgres

A PostgreSQL backend for Refile.

Build Status Code Climate Test Coverage

Why?

  • You want to store all your data in one place to simplify backups and replication
  • ACID

Take into account

  • Gem is developed and tested using Postgresql 9.3, Ruby 2.1 and ActiveRecord 4.x. It might work with earlier versions.
  • Performance hit storing files in database
  • Higher memory requirements for database
  • Backups can take significantly longer

Installation

Add this line to your application's Gemfile:

gem 'refile-postgres', '~> 1.4.0'

And then execute:

$ bundle

Or install it yourself as:

$ gem install refile-postgres

Usage with Rails

Application must have sql as schema format to properly dump OID type.

# config/application.rb
config.active_record.schema_format = :sql

Generate migration for table were to store list of attachments.

$ rails g refile:postgres:migration

Run the migrations

$ rake db:migrate

Generate initializer and set Refile::Postgres as store backend.

$ rails g refile:postgres:initializer

Upgrade to 1.3.0

If you have been using refile-postgres before 1.3.0 version then please follow upgrade guide

Contributing

  1. Fork it ( https://github.com/krists/refile-postgres/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