clay-driver-base
Base driver for clay
Installation
$ npm install clay-driver-base --save
Usage
'use strict' const Driver = // Define custom driver { /* ... */ } { /* ... */ } { /* ... */ } { /* ... */ } { /* ... */ } const clayLump = const lump01 = /* ... */
For more detail, see API Guide
API
clay-driver-base@4.1.8
Base driver for clay
- Functions
Driver
Class
Functions
Driver
create(args) -> Create driver instance
Param | Type | Description |
---|---|---|
args | * |
Driver
Class
Abstract driver
new Driver()
Constructor of Driver class
Promise.<ClayEntity>
driver.one(resourceName, id, options) -> Get single entity from resource
Param | Type | Description |
---|---|---|
resourceName | string | Name of resource |
id | ClayId | Resource id |
options | Object | Options settings |
Promise.<ClayCollection>
driver.list(resourceName, condition, options) -> List entities from resource
Param | Type | Description |
---|---|---|
resourceName | string | Name of resource |
condition | ListCondition | List condition query |
options | Object | Options settings |
Promise.<ClayEntity>
driver.create(resourceName, attributes) -> Create a new entity with resource
Param | Type | Description |
---|---|---|
resourceName | string | Name of resource |
attributes | Object | Resource attributes to create |
Promise.<ClayEntity>
driver.update(resourceName, id, attributes) -> Update an existing entity in resource
Param | Type | Description |
---|---|---|
resourceName | string | Name of resource |
id | ClayId | Resource id |
attributes | Object | Resource attributes to update |
Promise.<number>
driver.destroy(resourceName, id) -> Delete a entity resource
Param | Type | Description |
---|---|---|
resourceName | string | Name of resource |
id | ClayId | Resource id |
Promise.<boolean>
driver.drop(resourceName) -> Drop resource
Param | Type | Description |
---|---|---|
resourceName | string | Name of resource |
Promise.<Resource>
driver.resources() -> List resources
License
This software is released under the Apache-2.0 License.