Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gobuffalo/nulls
A collection of null types for the sql package
https://github.com/gobuffalo/nulls
go null sql
Last synced: 12 days ago
JSON representation
A collection of null types for the sql package
- Host: GitHub
- URL: https://github.com/gobuffalo/nulls
- Owner: gobuffalo
- License: mit
- Created: 2019-03-02T07:29:27.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-09-26T04:38:35.000Z (over 2 years ago)
- Last Synced: 2024-12-19T03:09:27.194Z (20 days ago)
- Topics: go, null, sql
- Language: Go
- Size: 30.3 KB
- Stars: 44
- Watchers: 9
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# github.com/gobuffalo/nulls
This package should be used in place of the built-in null types in the `sql` package.
The real benefit of this packages comes in its implementation of `MarshalJSON` and `UnmarshalJSON` to properly encode/decode `null` values.
## Installation
``` bash
$ go get github.com/gobuffalo/nulls
```## Supported Datatypes
* `string` (`nulls.String`) - Replaces `sql.NullString`
* `int64` (`nulls.Int64`) - Replaces `sql.NullInt64`
* `float64` (`nulls.Float64`) - Replaces `sql.NullFloat64`
* `bool` (`nulls.Bool`) - Replaces `sql.NullBool`
* `[]byte` (`nulls.ByteSlice`)
* `float32` (`nulls.Float32`)
* `int` (`nulls.Int`)
* `int32` (`nulls.Int32`)
* `uint32` (`nulls.UInt32`)
* `time.Time` (`nulls.Time`)
* `uuid.UUID` (`nulls.UUID`)