0.0.1 • Published 11 years ago
dsvdb v0.0.1
#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: FruitInitialize database, where testdata is the path of the database.
db = new dsvdb.Database 'testdata', modelsLoad all Fruit objects from files within directory testdata/Fruit.
db.loadFiles 'Fruit', (err, model) ->
console.log err, model0.0.1
11 years ago