0.14
No commit activity in last 3 years
No release in over 3 years
Simple library to parse PostgreSQL arrays into a array of strings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.9.2.2
~> 2.11.0
 Project Readme

PgArrayParser

Build Status Code Climate

Fast PostreSQL array parsing.

Installation

Add this line to your application's Gemfile:

gem 'pg_array_parser'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pg_array_parser

Usage

Include the PgArrayParser module, which provides the parse_pg_array method.

class MyPostgresParser
  include PgArrayParser
end

parser = MyPostgresParser.new
parser.parse_pg_array '{}'
# => []
parser.parse_pg_array '{1,2,3,4}'
# => ["1", "2", "3", "4"]
parser.parse_pg_array '{1,{2,3},4}'
# => ["1", ["2", "3"], "4"]
parser.parse_pg_array '{some,strings that,"May have some ,\'s"}'
# => ["some", "strings that", "May have some ,'s"]

Authors

Dan McClain twitter

Versioning

This gem follows Semantic Versioning

Want to help?

Stable branches are created based upon each minor version. Please make pull requests to specific branches rather than master.

Please make sure you include tests!

Don't use tabs to indent, two spaces are the standard.

Legal

DockYard, LLC © 2012

@dockyard

Licensed under the MIT license