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
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
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