New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

clay-driver-base

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clay-driver-base

Base driver for clay

latest
Source
npmnpm
Version
4.1.9
Version published
Weekly downloads
41
-22.64%
Maintainers
2
Weekly downloads
 
Created
Source

clay-driver-base

Build Status npm Version JS Standard

Base driver for clay

Installation

$ npm install clay-driver-base --save

Usage

'use strict'

const {Driver} = require('clay-driver-base')

// Define custom driver
class MyDriver extends Driver {
  one (namespace, id) { /* ... */ }

  list (namespace, condition) { /* ... */ }

  create (namespace, attributes) { /* ... */ }

  update (namespace, id, attributes) { /* ... */ }

  destroy (namespace, id) { /* ... */ }

}

{
  const clayLump = require('clay-lump')
  const lump01 = clayLump({
    driver: new MyDriver({/* ... */})
  })
  /* ... */
}

For more detail, see API Guide

API

clay-driver-base@4.1.8

Base driver for clay

Functions

create(args) -> Driver

Create driver instance

ParamTypeDescription
args*

Driver Class

Abstract driver

new Driver()

Constructor of Driver class

driver.one(resourceName, id, options) -> Promise.<ClayEntity>

Get single entity from resource

ParamTypeDescription
resourceNamestringName of resource
idClayIdResource id
optionsObjectOptions settings

driver.list(resourceName, condition, options) -> Promise.<ClayCollection>

List entities from resource

ParamTypeDescription
resourceNamestringName of resource
conditionListConditionList condition query
optionsObjectOptions settings

driver.create(resourceName, attributes) -> Promise.<ClayEntity>

Create a new entity with resource

ParamTypeDescription
resourceNamestringName of resource
attributesObjectResource attributes to create

driver.update(resourceName, id, attributes) -> Promise.<ClayEntity>

Update an existing entity in resource

ParamTypeDescription
resourceNamestringName of resource
idClayIdResource id
attributesObjectResource attributes to update

driver.destroy(resourceName, id) -> Promise.<number>

Delete a entity resource

ParamTypeDescription
resourceNamestringName of resource
idClayIdResource id

driver.drop(resourceName) -> Promise.<boolean>

Drop resource

ParamTypeDescription
resourceNamestringName of resource

driver.resources() -> Promise.<Resource>

List resources

License

This software is released under the Apache-2.0 License.

Keywords

ClayDB

FAQs

Package last updated on 16 May 2020

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