func (h Hstore) Value() (driver.Value, error) { hstore := hstore.Hstore{Map: map[string]sql.NullString{}} if len(h) == 0 { return nil, nil } for key, value := range h { hstore.Map[key] = sql.NullString{String: *value, Valid: true} } return hstore.Value() }