https://github.com/kadnan/gkeevee
A simple file based key/value store DB in Go language
https://github.com/kadnan/gkeevee
database go golang key-value
Last synced: 2 months ago
JSON representation
A simple file based key/value store DB in Go language
- Host: GitHub
- URL: https://github.com/kadnan/gkeevee
- Owner: kadnan
- License: mit
- Created: 2020-04-23T09:29:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T13:54:10.000Z (about 6 years ago)
- Last Synced: 2026-01-02T18:29:23.707Z (6 months ago)
- Topics: database, go, golang, key-value
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gKeeVee - A simple key-value store DB in Go
[](https://travis-ci.org/kadnan/gkeevee)
`gKeeVee` is a simple file based key-value store DB written in Go language. It uses [MessagePack](https://msgpack.org/index.html) to store the compressed data into a file.
## What's new in gKeeVee?
Infact nothing. I made this package as a part of my journey learning Golang. There are many other packages available like **Badger** which provides more facilities.
`gKeeVee` is a very simple db that only accepts `strings` as value. It is by design. If you want to store values like `int`, `float` etc, you will have to cast them to strings first and then store. For complex structures like `map` or `struct` you can convert them into a JSON string and store them as value.
## Installation
- Install `msgpack` package:
`go get github.com/vmihailenco/msgpack/`
## Test
`go test -v`
## Example
```
package main
import (
"fmt"
gkeevee "github.com/kadnan/gKeeVee/gKeeVee"
)
func main() {
f, err := gkeevee.Load("mytesting.db")
if err != nil {
println(err)
}
gkeevee.Set("FNAME", "ADNAN")
gkeevee.Set("LNAME", "SIDDIQI")
val, err := gkeevee.Get("FNAME")
if err != nil {
fmt.Println(err)
}
fmt.Println(val)
_, err = gkeevee.Save(f)
}
```