Home Reference Source Test
import BaseAdapter from 'kinto/lib/adapters/base.js'
public class | source

BaseAdapter

Direct Subclass:

IDB

Base db adapter.

Method Summary

Public Methods
public abstract

clear(): Promise

Deletes every records present in the database.

public abstract

execute(callback: Function, options: Object): Promise

Executes a batch of operations within a single transaction.

public abstract

get(id: String): Promise

Retrieve a record by its primary key from the database.

public abstract

getLastModified(): Promise

Retrieve saved lastModified value.

public
public abstract

importBulk(records: Array): Promise

Load records in bulk that were exported from a server.

public abstract

list(params: Object): Promise

Lists all records from the database.

public abstract

loadDump(records: Array): Promise

this method was deprecated. Use {@link importBulk} instead.

Load a dump of records exported from a server.

public abstract

saveLastModified(lastModified: Number): Promise

Store the lastModified value.

public

saveMetadata(metadata: *)

Public Methods

public abstract clear(): Promise source

Deletes every records present in the database.

Return:

Promise

public abstract execute(callback: Function, options: Object): Promise source

Executes a batch of operations within a single transaction.

Params:

NameTypeAttributeDescription
callback Function

The operation callback.

options Object

The options object.

Return:

Promise

public abstract get(id: String): Promise source

Retrieve a record by its primary key from the database.

Params:

NameTypeAttributeDescription
id String

The record id.

Return:

Promise

public abstract getLastModified(): Promise source

Retrieve saved lastModified value.

Return:

Promise

public getMetadata() source

public abstract importBulk(records: Array): Promise source

Load records in bulk that were exported from a server.

Params:

NameTypeAttributeDescription
records Array

The records to load.

Return:

Promise

public abstract list(params: Object): Promise source

Lists all records from the database.

Params:

NameTypeAttributeDescription
params Object

The filters and order to apply to the results.

Return:

Promise

public abstract loadDump(records: Array): Promise source

this method was deprecated. Use {@link importBulk} instead.

Load a dump of records exported from a server.

Params:

NameTypeAttributeDescription
records Array

The records to load.

Return:

Promise

public abstract saveLastModified(lastModified: Number): Promise source

Store the lastModified value.

Params:

NameTypeAttributeDescription
lastModified Number

Return:

Promise

public saveMetadata(metadata: *) source

Params:

NameTypeAttributeDescription
metadata *