Home
Softono

Tinydb

Open source MIT Go
44
Stars
2
Forks
1
Issues
2
Watchers
2 years
Last Commit

 About Tinydb

TinyDB is a lightweight document oriented database optimized for your happiness :)

Platforms

Web Self-hosted

Languages

Python Go

Need Help Installing Tinydb?

We provide expert installation service for this software. Our team will install, configure, and secure Tinydb on your server. plans start at just $30.

tinydb

Introduction

TinyDB is a lightweight document oriented database optimized for your happiness :) The target are small apps that would be blown away by a SQL-DB or an external database server.

But in this project, it's written in pure Golang and has no external dependencies.

Example Code

Import

import tiny "github.com/Yiwen-Chan/tinydb"

New a storage

storage, err := tiny.JSONStorage("test.json")

Open a database used by storage

database, err := tiny.TinyDB(storage)
defer database.Close()

Get a table and Insert or Delete or Update or Select

table := tiny.GetTable[student](database)
table.Insert(student{001, "test"})
table.Update(func(s student) student { s.ID = 002; return s }, func(s student) bool { return true })
table.Select(func(s student) bool { return true })
table.Delete(func(s student) bool { return true })