From 401fac5fa28aa05d5533eca56a0e6f20fc132e47 Mon Sep 17 00:00:00 2001 From: Andy Walker Date: Mon, 22 Sep 2014 13:22:15 -0400 Subject: [PATCH] document ParseHstore --- hstore.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hstore.go b/hstore.go index 0eead6dc..332ad4b7 100644 --- a/hstore.go +++ b/hstore.go @@ -80,6 +80,11 @@ func parseHstoreToNullHstore(s string) (store map[string]NullString, err error) return } +// ParseHstore parses the string representation of an hstore column (the same +// you would get from an ordinary SELECT) into two slices of keys and values. it +// is used internally in the default parsing of hstores, but is exported for use +// in handling custom data structures backed by an hstore column without the +// overhead of creating a map[string]string func ParseHstore(s string) (k []string, v []NullString, err error) { if s == "" { return