Skip to content

deoxxa/pgparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgparser

GoDoc

Overview

This package can unpack complex types from Postgres into structs, slices, and primitive values.

Example

Also see example_test.go in this directory.

import (
  "fmt"

  "fknsrs.biz/p/pgparser"
)

func ExampleParse() {
  var s = `(a,{x,y,z},5)`

  var v struct{
    A string
    B []string
    C int
  }

  if err := pgparser.Unmarshal(s, &v); err != nil {
    panic(err)
  }

  fmt.Printf("%#v\n", v)

  // Output:
  // struct { A string; B []string; C int }{A:"a", B:[]string{"x", "y", "z"}, C:5}
}

License

3-clause BSD. A copy is included with the source.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages