0.02
No commit activity in last 3 years
No release in over 3 years
DataMapper plugin providing HSTORE and ARRAY datatype support for postgres
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8.4
~> 1.3.2

Runtime

~> 1.2.0
~> 0.10.6
~> 1.2.0
~> 1.2.0
~> 0.10.6
~> 0.9.2
 Project Readme

dm-pg-types

Installation

dm-pg-types is available as a RubyGem. Simply put this in your Gemfile

gem 'dm-pg-types'

and you should be good to go.

DataMapper plugin providing support for PostgreSQL's HSTORE and ARRAY types. An example will suffice

DataMapper.setup(:default, 'postgres://localhost/dm_pg_types_person')
DataMapper.repository(:default).adapter.execute("DROP TABLE IF EXISTS people")
DataMapper.repository(:default).adapter.execute("CREATE EXTENSION HSTORE")

class Person
  include DataMapper::Resource

  property :id,        Serial
  property :name,      String
  property :info,      HStore
  property :decimals,  DecimalArray, :scale => 5, :precision => 10
end

DataMapper.finalize
DataMapper.auto_migrate!

p = Person.new
p.info = {:a => "b", :c => "d"}
p.decimals = [10.1, 11.2]
p.save

Thanks to https://github.com/softa/activerecord-postgres-hstore for doing most of the heavy lifting