Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lorencerri/quick.db-docs
Quick.db Documentation
https://github.com/lorencerri/quick.db-docs
docs documentation quickdb
Last synced: 18 days ago
JSON representation
Quick.db Documentation
- Host: GitHub
- URL: https://github.com/lorencerri/quick.db-docs
- Owner: lorencerri
- Created: 2018-03-01T08:19:12.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-17T17:30:05.000Z (over 3 years ago)
- Last Synced: 2024-10-03T16:15:19.144Z (about 1 month ago)
- Topics: docs, documentation, quickdb
- Homepage: https://quickdb.js.org
- Size: 126 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Introduction
_This package is meant to provide an easy way to create and use a database, **all data is stored persistently**, and comes with additional easy to use features._
**Installation**
```ruby
npm install quick.db
```**Require Package**
```javascript
var db = require('quick.db')
```## What is Quick.db?
> Quick.db is an easy-to-use database manager built with better-sqlite3. It's simple by design and perfect for smaller projects where you don't want to set up a separate database server or individuals who may be getting started with programming.
## Example
> _All data in quick.db is stored **persistently** in a database. Here is an example of setting an object in the database, then fetching parts & the full object._
```javascript
const db = require('quick.db');// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' })
// -> { difficulty: 'Easy' }// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword')
// -> { difficulty: 'Easy', items: ['Sword'] }// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }// Repeating previous examples:
db.push('userInfo.items', 'Watch')
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }// Fetching individual properties
db.get('userInfo.balance') // -> 1000
db.get('userInfo.items') // -> ['Sword', 'Watch']// Showing dot notation setting
db.set('userInfo.difficulty', 'Hard')
// -> { difficulty: 'Hard', items: ['Sword', 'Watch'], balance: 1000 }db.get('userInfo.difficulty') // -> 'Hard'
```## Our Sponsor
**Need A VPS?** Get started with **Contabo**! Up to 60 GB RAM - 10 Cores - Unlimited Traffic **Starting at €3.99**
[**Click To Learn More & View Prices**](http://www.anrdoezrs.net/click-9103034-12740668)