Skip to content
/ sqlnull Public

Go sql.Null-Types that implement Un/MarshalJSON

License

Notifications You must be signed in to change notification settings

gKits/sqlnull

Repository files navigation

SQLNull

go-version-badge test-pipeline-badge test-coverage-badge

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 which implement the Marshaler and Unmarshaler interface of the encoding/json package.

Usage

  1. Get the package
go get github.com/gkits/nullsql@latest
  1. Import the package
import "github.com/gkits/nullsql"
  1. Start coding...

Limitations

Due to the internal implementation of the encoding/json package you can sadly not omit the fields with value null using the omitempty tag.

About

Go sql.Null-Types that implement Un/MarshalJSON

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages