SkillAgentSearch skills...

Tinydb

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

Install / Use

/learn @kanrichan/Tinydb
About this skill

Quality Score

0/100

Supported Platforms

Zed

README

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 })
View on GitHub
GitHub Stars44
CategoryData
Updated1y ago
Forks2

Languages

Go

Security Score

80/100

Audited on Jan 6, 2025

No findings