Skip to content

puresoul/jdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jdb

Compressed json flatfile "database" (it's golang map datatype actualy) with simple key/value api

Example how to open (one time file read), read from db and save it to file

package main

import (
	"github.com/puresoul/jdb"
	"fmt"
)

func main() {
	// Create database file
	d := jdb.Open("test.db")

	// Insert string
	d.Map["test"] = "test"
	fmt.Println(d.Map)

	// Save
	_ = d.Close()

	d = jdb.Open("test.db")

	// Read String
	t := d.ReadStr("test")
	fmt.Println(t)

	// Write Int
	d.Map["tst"] = 123
	_ = d.Close()

	d = jdb.Open("test.db")

	// Read Int
	i := d.ReadInt("tst")
	fmt.Println(i+i)
}
``

About

Compressed json flatfile database with simple key/value api

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages