API Docs for: 0.0.1
Show:

LocalStorage Class

Module: localstorage
Parent Module: client-db

Creating floating Panel-nodes which can be shown and hidden.

Copyright (c) 2014 ITSA - https://github.com/itsa New BSD License - http://choosealicense.com/licenses/bsd-3-clause/

Methods

clear

(
  • table
)
Promise

Defined in src/client-db/lib/localstorage.js:637

Available since 0.0.1

Empties the table.

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is undefined

clearTable

(
  • table
)
protected

Defined in src/client-db/lib/localstorage.js:218

Available since 0.0.1

Parameters:

contains

(
  • table
  • obj
)
Promise

Defined in src/client-db/lib/localstorage.js:665

Available since 0.0.1

Checks whether a table has a containes a specified record, not by reference, by by checking its property-values

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is a boolean specifying whether the table has a matched record

defineDatabase

(
  • dbName
  • version
  • tables
)
protected

Defined in src/client-db/lib/localstorage.js:140

Available since 0.0.1

Parameters:

delete

(
  • table
  • prop
  • matches
)
Promise

Defined in src/client-db/lib/localstorage.js:695

Available since 0.0.1

Deletes all records of the table that have a match, defined by the matches the prop

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is an Array with all records that have been deleted

deleteDatabase

() Promise

Defined in src/client-db/lib/localstorage.js:709

Available since 0.0.1

Deletes a database from the client

Returns:

Promise:

Returnvalue of the fulfilled promise is undefined

each

(
  • table
  • fn
  • context
)
Promise

Defined in src/client-db/lib/localstorage.js:565

Available since 0.0.1

Performs a function to all the records of the table

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is undefined

getDatabaseDef

(
  • db
  • version
  • tables
)
protected

Defined in src/client-db/lib/localstorage.js:248

Available since 0.0.1

Parameters:

getItem

(
  • key
  • reviver
)
protected

Defined in src/client-db/lib/localstorage.js:31

Available since 0.0.1

Parameters:

getNextFreePos

() protected

Defined in src/client-db/lib/localstorage.js:263

Available since 0.0.1

getTableDef

(
  • dbDef
  • table
)
protected

Defined in src/client-db/lib/localstorage.js:76

Available since 0.0.1

Parameters:

has

(
  • table
  • prop
  • matches
)
Promise

Defined in src/client-db/lib/localstorage.js:649

Available since 0.0.1

Checks whether a table has a matched record, defined by the matches the prop

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is a boolean specifying whether the table has a matched record

initializePositions

() protected

Defined in src/client-db/lib/localstorage.js:283

Available since 0.0.1

readAll

(
  • table
)
Promise

Defined in src/client-db/lib/localstorage.js:553

Available since 0.0.1

Retrieves all records of the table

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is an Array with all Objects (records) within the table

readMany

(
  • table
  • prop
  • matches
)
Promise

Defined in src/client-db/lib/localstorage.js:539

Available since 0.0.1

Reads multiple records, specified by matches.

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is an Array with Objects (records)

readOneByKey

(
  • table
  • key
  • matches
)
Promise

Defined in src/client-db/lib/localstorage.js:525

Available since 0.0.1

Reads one record, specified by its key.

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is an Object (record)

readTableItem

(
  • dbDef
  • dbName
  • table
  • key
  • matches
  • reviver
)
protected

Defined in src/client-db/lib/localstorage.js:349

Available since 0.0.1

Parameters:

readTableItems

(
  • dbDef
  • dbName
  • table
  • prop
  • matches
  • reviver
  • deleteMatch
)
protected

Defined in src/client-db/lib/localstorage.js:308

Available since 0.0.1

Parameters:

removeDatabase

(
  • dbDef
  • dbName
)
protected

Defined in src/client-db/lib/localstorage.js:186

Available since 0.0.1

Parameters:

removeTableItem

(
  • dbDef
  • dbName
  • table
  • pos
)
protected

Defined in src/client-db/lib/localstorage.js:96

Available since 0.0.1

Parameters:

save

(
  • table
  • records
  • overwriteUnique
)
Promise

Defined in src/client-db/lib/localstorage.js:404

Available since 0.0.1

Saves a record. Returns an undefined promise when ready.

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is undefined

setItem

(
  • key
  • value
)
protected

Defined in src/client-db/lib/localstorage.js:55

Available since 0.0.1

Parameters:

size

(
  • table
)
Promise

Defined in src/client-db/lib/localstorage.js:682

Available since 0.0.1

Gets the number of records in the table

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is a number

some

(
  • table
  • fn
  • context
)
Promise

Defined in src/client-db/lib/localstorage.js:599

Available since 0.0.1

Performs a function to some the records of the table. If the invoked function returns a trutthy value, the loop ends.

Parameters:

Returns:

Promise:

Returnvalue of the fulfilled promise is undefined