Socket
Book a DemoInstallSign in
Socket

rethinkly

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rethinkly

a library to make easier the operations handling in rethinkdb

1.5.1
latest
Source
npmnpm
Version published
Weekly downloads
26
Maintainers
1
Weekly downloads
 
Created
Source

Rethinkly 🚀

Build Status Maintainability Test Coverage

👷 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'
    }
]
*/

Keywords

rethinkdb

FAQs

Package last updated on 26 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.