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

You Might Also Like
Automated quote and proposal software for IT solution providers. | ConnectWise CPQ Icon
Automated quote and proposal software for IT solution providers. | ConnectWise CPQ

Create IT quote templates, automate workflows, add integrations & price catalogs to save time & reduce errors on manual data entry & updates.

ConnectWise CPQ, formerly ConnectWise Sell, is a professional quote and proposal automation software for IT solution providers. ConnectWise CPQ offers a wide range of tools that enables IT solution providers to save time, quote more, and win big. Top features include professional quote or proposal templates, product catalog and sourcing, workflow automation, sales reporting, and integrations with best-in-breed solutions like Cisco, Dell, HP, and Salesforce.
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