null is a library with reasonable options for dealing with nullable SQL and JSON values. There are two packages: null and its subpackage zero. Types in null will only be considered null on null input, and will JSON encode to null. If you need zero and null be considered separate values, use these. Types in zero are treated like zero values in Go: blank string input will produce a null zero.String, and null Strings will JSON encode to "". Zero values of these types will be considered null to SQL. If you need zero and null treated the same, use these. All types implement sql.Scanner and driver.Valuer, so you can use this library in place of sql.NullXXX. All types also implement: encoding.TextMarshaler, encoding.TextUnmarshaler, json.Marshaler, and json.Unmarshaler. A null object's MarshalText will return a blank string.

Features

  • It will only support the types that driver.Value supports
  • This package isn't intended to be a catch-all data-wrangling package
  • Marshals to JSON null if SQL source data is null. Zero input will not produce a null Int.
  • There are two packages: null and its subpackage zero
  • Types in zero are treated like zero values in Go
  • null is a library with reasonable options for dealing with nullable SQL and JSON values

Project Samples

Project Activity

See All Activity >

Categories

Frameworks

License

BSD License

Follow null

null Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of null!

Additional Project Details

Operating Systems

Linux, Mac, Windows

Programming Language

Go

Related Categories

Go Frameworks

Registered

2023-01-30