Categorygithub.com/greensea/sqljsondb
modulepackage
1.0.1
Repository: https://github.com/greensea/sqljsondb.git
Documentation: pkg.go.dev

# README

sqljsondb GoDoc

a key-value json document DB but use MySQL as storage

Usage

db := sqljsondb.New("user:pass@tcp(127.0.0.1:3306)/dbname", "")


db.Write("people", "1", "Alice")
db.Write("people", "2", "Bob")

var name string
db.Read("people", "2", name)
fmt.Println(name)     /// Bob

fmt.Println(db.Keys("people"))    /// {"1", "2"}


db.WriteIgnore("people", "2", "Bob")   /// Does nothing because document "2" is already "Bob"
db.WriteIgnore("people", "2", "Evil")  /// Document "2" updated to "Evil"

For more usage check doc

# Functions

Compare if two JSON string is equal in object level.
dsn is the DSN connection string.

# Structs

No description provided by the author