nano-trivial
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

Nano-Trivial

TrivialDB Driver for nanoSQL

Lets you use TrivialDB as a backend datastore for nanoSQL.

TrivialDB is a simple JSON file storage database. All changes are saved to disk as JSON files allowing you to easily view and edit database contents.

nanoSQL Logo

NPM

Documentation

Installation

npm i --save nano-trivial

Usage

import { nSQL } from "nano-sql";
import { TrivialAdapter } from "nano-trivial";
 
nSQL("table")
.model([...])
.config({
    mode: new TrivialAdapter(),
    ...other config options
}).connect()...

That's it, now everything NanoSQL can do you can do with TrivialDB.

Read about NanoSQL here.

API

When you call new TrivialAdapter there are two optional arguments, namespace arguments and database arguments.

The namespace arguments are documented here and mostly allow you to adjust the location the files are saved to.

The database arguments are documented here and allow you to do more advanced things like controlling wethere the JSON files are pretty printed or not.

Package Sidebar

Install

npm i nano-trivial

Homepage

nanosql.io

Weekly Downloads

8

Version

1.3.0

License

MIT

Unpacked Size

22.6 kB

Total Files

8

Last publish

Collaborators

  • clicksimply