dsvdb

0.0.1 • Public • Published

DSV Database

DSVDB is a simple CSV file or TSV file based database. Maintaining data manually is as simple as working with a spreadsheet.

This database was designed for use as a append only database, with in-memory caching.

Installation

npm install dsvdb

Example

dsvdb = require 'dsvdb'

Define a object model

class Fruit extends dsvdb.Model
 model: 'Fruit'

 @defaults
  handle:
   type: 'string'
   default: ''
  name:
   type: 'string'
   default: ''
  price:
   type: 'decimal'
   default: ''

An object of all object models

models =
 Fruit: Fruit

Initialize database, where testdata is the path of the database.

db = new dsvdb.Database 'testdata', models

Load all Fruit objects from files within directory testdata/Fruit.

db.loadFiles 'Fruit', (err, model) ->
 console.log err, model

Readme

Keywords

Package Sidebar

Install

npm i dsvdb

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • vpj