Skip to content

Module: IndexedDB::IndexedQueryCompiler

Jovan Gerodetti edited this page Apr 14, 2021 · 5 revisions

IndexedQuery

exported: IndexedQuery
kind: object
declaration: const

A query object for an indexedDB request.

Properties

name

Type: string
kind: value

rangeStart

Type: *
kind: value

rangeEnd

Type: *
kind: value

Methods

IndexedQueryCompiler

exported: default
kind: object
declaration: const

the query compiler for indexedDB requests.

Properties

🚫 _currentQuery

Type: IndexedQuery
kind: value

🚫 _allQueries

Type: Array.<IndexedQuery>
kind: value

🚫 _store

Type: string
kind: value

🚫 _db

Type: Promise.<IDBDatabase>
kind: value

sortOrder

Type: string
kind: value

Methods

_make(storeName, db) => {undefined}

kind: function

creates a new indexed query

Name Type Description
storeName string the store to query
db Promise.<IDBDatabase> the db to query

🚫 _transformExclude(value, exclude) => {?}

kind: function

Name Type Description
value * [description]
exclude boolean [description]

where(indexName) => {IndexedQueryCompiler}

kind: function

adds a where clause to the query.

Name Type Description
indexName string the index to operate on

equals(value) => {IndexedQueryCompiler}

kind: function

filters items from the result if the index doesn't match the given value.

Name Type Description
value * value to compare

from(value, [exclude=false]) => {IndexedQueryCompiler}

kind: function

starts a new value range

Name Type Description
value * range start value
[exclude=false] boolean determines if the start value will be included in the range

to(value, [exclude=false]) => {IndexedQueryCompiler}

kind: function

ends a value range

Name Type Description
value * end value of the range
[exclude=false] boolean determines if the end value will be included in the range

lowerThan(value) => {IndexedQueryCompiler}

kind: function

filters items from the result where the index is lower than the given value

Name Type Description
value *

higherThan(value) => {IndexedQueryCompiler}

kind: function

filters items from the result where the index is higher than the given value

Name Type Description
value *

or(indexName) => {IndexedQueryCompiler}

kind: function

starts an or clause to query an additional index

Name Type Description
indexName string [description]

sort(direction) => {IndexedQueryCompiler}

kind: function

applies a sort order to the query results

Name Type Description
direction 'ASC'|'DESC' sort direction

get(limit) => {Promise.<Array>}

kind: function

assembles the results based on the composed query

Name Type Description
limit ...number one or two arguments which represent the start and end of the result range

🚫 _execute(start, end) => {Promise.<Array>}

kind: function

Name Type Description
start number start index
end number end index

Clone this wiki locally