jsontype
A JSON type that round-trips between Go, JSON and SQL drivers (Postgres jsonb, MySQL json, SQLite).
go get github.com/ubgo/jsontype
- Language
- Go
- Go version
- 1.24
- Core deps
- 0 direct
- Latest tag
- v0.1.0
- License
- Apache-2.0
- Go modules
- 1
Code from the README
import "github.com/ubgo/jsontype"
type User struct {
ID int `json:"id"`
Settings jsontype.JSON `json:"settings"`
}
// Settings is stored as jsonb / json / TEXT in the DB and scans round-trip
// via sql.Scanner / driver.Valuer.From the jsontype README.