https://github.com/eugeneware/livelydb
Abstract base class for Lively live-streaming database implementations.
https://github.com/eugeneware/livelydb
Last synced: 4 months ago
JSON representation
Abstract base class for Lively live-streaming database implementations.
- Host: GitHub
- URL: https://github.com/eugeneware/livelydb
- Owner: eugeneware
- License: other
- Created: 2013-12-29T13:13:22.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-12-29T13:30:26.000Z (about 12 years ago)
- Last Synced: 2025-01-28T06:16:05.235Z (12 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - `levelup` - time data binding of a database with local javascript objects. (Legacy / [`level-lively`][level-lively])
README
# livelydb
Abstract base class for Lively live-streaming database implementations.
[](http://travis-ci.org/eugeneware/livelydb)
## Installation
This module is installed via npm:
``` bash
$ npm install livelydb
```
## Description
This is a base class that gets extended by database implementations that wish
to be able to synchronize a remote database with a local javascript object
using the Lively framework.
For an example, check out [MemLively](https://github.com/eugeneware/memlively).
The intention is for implementations of [levelup](https://github.com/rvagg/node-levelup)
and even SQL-based servers to be able to synchronize their data live, in
real-time to a local javascript object in both directions.
## API
### LivelyDb()
Constructor.
### livelydb.get(key, callback)
Retrieve the object stored in the database pointed to by the key.
The callback will be called with an error, and the data as the second argument.
### livelydb.put(key, value, callback)
Puts the object ```value``` into the database, referenced by the key ```key```.
### livelydb.del(key, callback)
Delets the object from the database, referenced by the key ```key```.