Skip to content

Commit

Permalink
docs: add readme text
Browse files Browse the repository at this point in the history
  • Loading branch information
gKits committed Oct 23, 2024
1 parent c05ea42 commit 3b7b3b1
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
# sqlnull
Go sql.Null-Types that implement Un/MarshalJSON
# SQLNull

A dead simple one stop solution to pass your database types directly to
your JSON REST-API.

This package provides wrapper types for all Null* types of the
[`database/sql`](https://pkg.go.dev/database/sql) which implement the
`Marshaler` and `Unmarshaler` interface of the
[`encoding/json`](https://pkg.go.dev/encoding/json) package.

## Usage

1. Get the package
```bash
go get github.com/gkits/nullsql@latest
```

2. Import the package
```go
import "github.com/gkits/nullsql"
```

3. Start coding...

## Limitations

Due to the internal implementation of the
[`encoding/json`](https://pkg.go.dev/encoding/json) package you can sadly
not omit the fields with value `null` using the `omitempty` tag.

0 comments on commit 3b7b3b1

Please sign in to comment.