https://github.com/dcsunset/mysql-kv-wrapper
A wrapper for KV operation in MySQL
https://github.com/dcsunset/mysql-kv-wrapper
Last synced: 3 months ago
JSON representation
A wrapper for KV operation in MySQL
- Host: GitHub
- URL: https://github.com/dcsunset/mysql-kv-wrapper
- Owner: DCsunset
- Created: 2021-09-26T16:58:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T23:59:30.000Z (over 4 years ago)
- Last Synced: 2024-12-31T09:44:43.655Z (over 1 year ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mysql-kv-wrapper
## Installation
```
go get github.com/DCsunset/mysql-kv-wrapper
```
## Examples
```go
package main
import (
kvstore "github.com/DCsunset/mysql-kv-wrapper"
)
func main() {
var store kvstore.KVStore
err := store.Open("root:password@/")
if err != nil {
panic(err)
}
defer store.Close()
err = store.Write("hello", "world")
if err != nil {
panic(err)
}
value, err := store.Read("hello")
if value != "world" {
panic("Wrong value")
}
}
```