1.5.1 • Published 2 years ago
rethinkly v1.5.1
Rethinkly 🚀
👷 Work in progress 🚧
A carefuly created set of bindings to present an easy way to handle RethinkDB instances.
Rethinkly is a collection of methods to make more literal and legible gathering data from rethink into JavaScript applications. Supports node and browser.
Rethink. Again.
Installation
- $ yarn add rethinkly
- $ npm i rethinkly --save
Available methods:
- createLink
- data get insert remove update seed
- table
- create
- drop database
- create
- drop
- checkForExistence
- list
Usage
import { createLink } from 'rethinkly'
const dbConfig = {
host: process.env.ENV === 'mock' ? '172.18.0.2' : 'localhost',
port: 32769,
db: 'the_database',
}
const instance = createLink(dbConfig)
API
Retrieving data (data.get)
- Method to get a list or a specific value from a table.
Params:
- connection: object
- tableName: string
- id?: string
Example
import { createLink, data } from 'rethinkly'
const instance = createLink(dbConfig)
// Get your data as list
const users = data.get(instance, 'users')
/** output
[
{
id: 'a3bbd8e3-b53f-4ecd-bab9-6c65cfcf931b',
name: 'Caio Alcantara',
nickname: 'caio',
role: '99bd6af9-922e-4787-a97d-3d915f60e65b'
}
]
*/
/**
* Match your results using where clause
*/
const users = data.get(instance, 'users', { role: '99bd6af9-922e-4787-a97d-3d915f60e65b' })
/**
* Implicit byId
*/
const users = data.get(instance, 'users', 'a3bbd8e3-b53f-4ecd-bab9-6c65cfcf931b')
/** output
[
{
id: 'a3bbd8e3-b53f-4ecd-bab9-6c65cfcf931b',
name: 'Caio Alcantara',
nickname: 'caio',
role: '99bd6af9-922e-4787-a97d-3d915f60e65b'
}
]
*/
1.5.1
2 years ago
1.5.0
2 years ago
1.4.3
3 years ago
1.4.2
3 years ago
1.4.1
3 years ago
1.4.0
4 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.2.2
4 years ago
1.2.0
4 years ago
1.2.1
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.4-7
5 years ago
1.0.4-6
5 years ago
1.0.4-5
5 years ago
1.0.4-4
5 years ago
1.0.4-3
5 years ago
1.0.4-2
5 years ago
1.0.4-1
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago