Update readme to include v5 changes
This commit is contained in:
parent
cdb95c128d
commit
b326f4655b
1 changed files with 27 additions and 3 deletions
30
README.md
30
README.md
|
@ -1,5 +1,5 @@
|
||||||
## null-extended [![GoDoc](https://godoc.org/github.com/nullbio/null?status.svg)](https://godoc.org/github.com/nullbio/null) [![Coverage](http://gocover.io/_badge/github.com/nullbio/null)](http://gocover.io/github.com/nullbio/null)
|
## null-extended [![GoDoc](https://godoc.org/github.com/nullbio/null?status.svg)](https://godoc.org/github.com/nullbio/null) [![Coverage](http://gocover.io/_badge/github.com/nullbio/null)](http://gocover.io/github.com/nullbio/null)
|
||||||
`import "gopkg.in/nullbio/null.v4"`
|
`import "gopkg.in/nullbio/null.v5"`
|
||||||
|
|
||||||
null-extended is a library with reasonable options for dealing with nullable SQL and JSON values
|
null-extended is a library with reasonable options for dealing with nullable SQL and JSON values
|
||||||
|
|
||||||
|
@ -13,7 +13,19 @@ All types implement `sql.Scanner` and `driver.Valuer`, so you can use this libra
|
||||||
|
|
||||||
### null package
|
### null package
|
||||||
|
|
||||||
`import "gopkg.in/nullbio/null.v4"`
|
`import "gopkg.in/nullbio/null.v5"`
|
||||||
|
|
||||||
|
#### null.JSON
|
||||||
|
Nullable []byte.
|
||||||
|
|
||||||
|
Will marshal to JSON null if Invalid. []byte{} input will not produce an Invalid JSON, but []byte(nil) will. This should be used for storing raw JSON in the database.
|
||||||
|
|
||||||
|
Also has `null.JSON.Marshal` and `null.JSON.Unmarshal` helpers to marshal and unmarshal foreign objects.
|
||||||
|
|
||||||
|
#### null.Bytes
|
||||||
|
Nullable []byte.
|
||||||
|
|
||||||
|
Will marshal to JSON null if Invalid. []]byte{} input will not produce an Invalid Bytes, but []byte(nil) will. This should be used for storing binary data (bytea in PSQL for example) in the database.
|
||||||
|
|
||||||
#### null.String
|
#### null.String
|
||||||
Nullable string.
|
Nullable string.
|
||||||
|
@ -91,7 +103,19 @@ Marshals to JSON null if SQL source data is null. Zero input will not produce a
|
||||||
|
|
||||||
### zero package
|
### zero package
|
||||||
|
|
||||||
`import "gopkg.in/nullbio/null.v4/zero"`
|
`import "gopkg.in/nullbio/null.v5/zero"`
|
||||||
|
|
||||||
|
#### zero.JSON
|
||||||
|
Nullable []byte.
|
||||||
|
|
||||||
|
Will marshal to JSON null if Invalid. []byte{} and []byte(nil) will produce an Invalid JSON. This should be used for storing raw JSON in the database.
|
||||||
|
|
||||||
|
Also has `null.JSON.Marshal` and `null.JSON.Unmarshal` helpers to marshal and unmarshal foreign objects.
|
||||||
|
|
||||||
|
#### zero.Bytes
|
||||||
|
Nullable []byte.
|
||||||
|
|
||||||
|
Will marshal to JSON null if Invalid. []byte{} and []byte(nil) will produce an Invalid Bytes. This should be used for storing binary data (bytea in PSQL for example) in the database.
|
||||||
|
|
||||||
#### zero.String
|
#### zero.String
|
||||||
Nullable string.
|
Nullable string.
|
||||||
|
|
Loading…
Reference in a new issue