https://github.com/nktmys/sqlnull
sqlnull is utilities for working with sql.Null types in Go.
https://github.com/nktmys/sqlnull
go golang null sql
Last synced: 24 days ago
JSON representation
sqlnull is utilities for working with sql.Null types in Go.
- Host: GitHub
- URL: https://github.com/nktmys/sqlnull
- Owner: nktmys
- License: mit
- Created: 2025-06-27T18:46:09.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-12-02T06:28:03.000Z (7 months ago)
- Last Synced: 2025-12-05T00:53:20.387Z (7 months ago)
- Topics: go, golang, null, sql
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sqlnull
[](https://github.com/nktmys/sqlnull/blob/main/go.mod)
[](https://pkg.go.dev/github.com/nktmys/sqlnull)
[](https://github.com/nktmys/sqlnull/releases)
[](https://goreportcard.com/report/github.com/nktmys/sqlnull)
[](https://github.com/nktmys/sqlnull/actions/workflows/test.yaml)
[](https://coveralls.io/github/nktmys/sqlnull?branch=main)
`sqlnull` is utilities for working with sql.Null types in Go.
## Installation
1. Get the package
```sh
go get github.com/nktmys/sqlnull
```
2. Import the package
```go
import "github.com/nktmys/sqlnull"
```
## Examples
This code:
```go
str := "hello"
v1 := sqlnull.From(str)
v2 := sqlnull.FromPtr(&str)
p1 := sqlnull.Prt(str)
p2 := sqlnull.PrtOrNil(&str)
vp := sqlnull.ValuePtrOrNil(v1)
```
## Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/nktmys/sqlnull/blob/main/LICENSE) file for details.