simpledb

A simple NoSQL JSON document database

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Installation

nimble install simpledb
choosenim install simpledb
git clone https://github.com/jjv360/nim-simpledb

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
simpledb - - - - - - -

Source

Repository https://github.com/jjv360/nim-simpledb
Homepage https://github.com/jjv360/nim-simpledb
Registry Source nimble_official

README

SimpleDB

A very simple NoSQL JSON document database written on top of SQLite.

Usage

import simpledb
import json

# Open or create a database
var db = SimpleDB.init("database.db")

# Write a document
db.put(%* {
    "id": "1234",
    "timestamp": 123456,
    "type": "example",
    "text": "Hello world!"
})

# Get a specific document by it's ID (null if not found)
var doc = db.get("1234")

# Fetch a document with a query
var doc = db.query().where("type", "==", "example").get()

# Fetch a list of documents with a query
var docs = db.query()
    .where("timestamp", ">=", 1000)
    .where("timestamp", "<=", 2000)
    .limit(5)
    .offset(2)
    .list()

# Delete documents
db.remove("1234")
db.query().where("type", "==", "example").remove()

# Batch modifications
db.batch do():
    db.put(%* { "name": "item1" })
    db.put(%* { "name": "item2" })
    db.put(%* { "name": "item3" })

# Close the database
db.close()

See tests.nim for more examples.