Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MyDB

The app's Dexie database

Hierarchy

  • Dexie
    • MyDB

Index

Constructors

constructor

Properties

Collection

Collection: object

Type declaration

and

  • and(filter: function): Collection<T, Key>
  • Parameters

    • filter: function
        • (x: T): boolean
        • Parameters

          • x: T

          Returns boolean

    Returns Collection<T, Key>

clone

  • clone(props?: Object): Collection<T, Key>
  • Parameters

    • Optional props: Object

    Returns Collection<T, Key>

count

  • count(): Promise<number>
  • count<R>(thenShortcut: ThenShortcut<number, R>): Promise<R>
  • Returns Promise<number>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<number, R>

    Returns Promise<R>

delete

  • delete(): Promise<number>
  • Returns Promise<number>

distinct

  • distinct(): Collection<T, Key>
  • Returns Collection<T, Key>

each

  • each(callback: function): Promise<void>
  • Parameters

    • callback: function
        • (obj: T, cursor: object): any
        • Parameters

          • obj: T
          • cursor: object
            • key: IndexableType
            • primaryKey: Key

          Returns any

    Returns Promise<void>

eachKey

  • eachKey(callback: function): Promise<void>
  • Parameters

    • callback: function
        • (key: IndexableType, cursor: object): any
        • Parameters

          • key: IndexableType
          • cursor: object
            • key: IndexableType
            • primaryKey: Key

          Returns any

    Returns Promise<void>

eachPrimaryKey

  • eachPrimaryKey(callback: function): Promise<void>
  • Parameters

    • callback: function
        • (key: Key, cursor: object): any
        • Parameters

          • key: Key
          • cursor: object
            • key: IndexableType
            • primaryKey: Key

          Returns any

    Returns Promise<void>

eachUniqueKey

  • eachUniqueKey(callback: function): Promise<void>
  • Parameters

    • callback: function
        • (key: IndexableType, cursor: object): any
        • Parameters

          • key: IndexableType
          • cursor: object
            • key: IndexableType
            • primaryKey: Key

          Returns any

    Returns Promise<void>

filter

  • filter(filter: function): Collection<T, Key>
  • Parameters

    • filter: function
        • (x: T): boolean
        • Parameters

          • x: T

          Returns boolean

    Returns Collection<T, Key>

first

  • first(): Promise<T | undefined>
  • first<R>(thenShortcut: ThenShortcut<T | undefined, R>): Promise<R>
  • Returns Promise<T | undefined>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<T | undefined, R>

    Returns Promise<R>

keys

  • keys(): Promise<IndexableTypeArray>
  • keys<R>(thenShortcut: ThenShortcut<IndexableTypeArray, R>): Promise<R>
  • Returns Promise<IndexableTypeArray>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<IndexableTypeArray, R>

    Returns Promise<R>

last

  • last(): Promise<T | undefined>
  • last<R>(thenShortcut: ThenShortcut<T | undefined, R>): Promise<R>
  • Returns Promise<T | undefined>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<T | undefined, R>

    Returns Promise<R>

limit

  • limit(n: number): Collection<T, Key>
  • Parameters

    • n: number

    Returns Collection<T, Key>

modify

  • modify(changeCallback: function): Promise<number>
  • modify(changes: object): Promise<number>
  • Parameters

    • changeCallback: function
        • (obj: T, ctx: object): void
        • Parameters

          • obj: T
          • ctx: object
            • value: T

          Returns void

    Returns Promise<number>

  • Parameters

    • changes: object
      • [keyPath: string]: any

    Returns Promise<number>

offset

  • offset(n: number): Collection<T, Key>
  • Parameters

    • n: number

    Returns Collection<T, Key>

or

  • or(indexOrPrimayKey: string): WhereClause<T, Key>
  • Parameters

    • indexOrPrimayKey: string

    Returns WhereClause<T, Key>

primaryKeys

  • primaryKeys(): Promise<Key[]>
  • primaryKeys<R>(thenShortcut: ThenShortcut<Key[], R>): Promise<R>
  • Returns Promise<Key[]>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<Key[], R>

    Returns Promise<R>

raw

  • raw(): Collection<T, Key>
  • Returns Collection<T, Key>

reverse

  • reverse(): Collection<T, Key>
  • Returns Collection<T, Key>

sortBy

  • sortBy(keyPath: string): Promise<T[]>
  • sortBy<R>(keyPath: string, thenShortcut: ThenShortcut<T[], R>): Promise<R>
  • Parameters

    • keyPath: string

    Returns Promise<T[]>

  • Type parameters

    • R

    Parameters

    • keyPath: string
    • thenShortcut: ThenShortcut<T[], R>

    Returns Promise<R>

toArray

  • toArray(): Promise<Array<T>>
  • toArray<R>(thenShortcut: ThenShortcut<T[], R>): Promise<R>
  • Returns Promise<Array<T>>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<T[], R>

    Returns Promise<R>

uniqueKeys

  • uniqueKeys(): Promise<IndexableTypeArray>
  • uniqueKeys<R>(thenShortcut: ThenShortcut<IndexableTypeArray, R>): Promise<R>
  • Returns Promise<IndexableTypeArray>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<IndexableTypeArray, R>

    Returns Promise<R>

until

  • until(filter: function, includeStopEntry?: undefined | false | true): Collection<T, Key>
  • Parameters

    • filter: function
        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    • Optional includeStopEntry: undefined | false | true

    Returns Collection<T, Key>

Table

Table: object

Type declaration

hook

hook: TableHooks<T, Key>

name

name: string

schema

schema: TableSchema

add

  • add(item: T, key?: Key): Promise<Key>
  • Parameters

    • item: T
    • Optional key: Key

    Returns Promise<Key>

bulkAdd

  • bulkAdd(items: T[], keys?: IndexableTypeArrayReadonly): Promise<Key>
  • Parameters

    • items: T[]
    • Optional keys: IndexableTypeArrayReadonly

    Returns Promise<Key>

bulkDelete

  • bulkDelete(keys: IndexableTypeArrayReadonly): Promise<void>
  • Parameters

    • keys: IndexableTypeArrayReadonly

    Returns Promise<void>

bulkPut

  • bulkPut(items: T[], keys?: IndexableTypeArrayReadonly): Promise<Key>
  • Parameters

    • items: T[]
    • Optional keys: IndexableTypeArrayReadonly

    Returns Promise<Key>

clear

  • clear(): Promise<void>
  • Returns Promise<void>

count

  • count(): Promise<number>
  • count<R>(thenShortcut: ThenShortcut<number, R>): Promise<R>
  • Returns Promise<number>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<number, R>

    Returns Promise<R>

delete

  • delete(key: Key): Promise<void>
  • Parameters

    • key: Key

    Returns Promise<void>

each

  • each(callback: function): Promise<void>
  • Parameters

    • callback: function
        • (obj: T, cursor: object): any
        • Parameters

          • obj: T
          • cursor: object
            • key: IndexableType
            • primaryKey: Key

          Returns any

    Returns Promise<void>

filter

  • filter(fn: function): Collection<T, Key>
  • Parameters

    • fn: function
        • (obj: T): boolean
        • Parameters

          • obj: T

          Returns boolean

    Returns Collection<T, Key>

get

  • get(key: Key): Promise<T | undefined>
  • get<R>(key: Key, thenShortcut: ThenShortcut<T | undefined, R>): Promise<R>
  • get(equalityCriterias: object): Promise<T | undefined>
  • get<R>(equalityCriterias: object, thenShortcut: ThenShortcut<T | undefined, R>): Promise<R>
  • Parameters

    • key: Key

    Returns Promise<T | undefined>

  • Type parameters

    • R

    Parameters

    • key: Key
    • thenShortcut: ThenShortcut<T | undefined, R>

    Returns Promise<R>

  • Parameters

    • equalityCriterias: object
      • [key: string]: IndexableType

    Returns Promise<T | undefined>

  • Type parameters

    • R

    Parameters

    • equalityCriterias: object
      • [key: string]: IndexableType
    • thenShortcut: ThenShortcut<T | undefined, R>

    Returns Promise<R>

limit

  • limit(n: number): Collection<T, Key>
  • Parameters

    • n: number

    Returns Collection<T, Key>

mapToClass

  • mapToClass(constructor: Function): Function
  • Parameters

    • constructor: Function

    Returns Function

offset

  • offset(n: number): Collection<T, Key>
  • Parameters

    • n: number

    Returns Collection<T, Key>

orderBy

  • orderBy(index: string | string[]): Collection<T, Key>
  • Parameters

    • index: string | string[]

    Returns Collection<T, Key>

put

  • put(item: T, key?: Key): Promise<Key>
  • Parameters

    • item: T
    • Optional key: Key

    Returns Promise<Key>

reverse

  • reverse(): Collection<T, Key>
  • Returns Collection<T, Key>

toArray

  • toArray(): Promise<Array<T>>
  • toArray<R>(thenShortcut: ThenShortcut<T[], R>): Promise<R>
  • Returns Promise<Array<T>>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<T[], R>

    Returns Promise<R>

toCollection

  • toCollection(): Collection<T, Key>
  • Returns Collection<T, Key>

update

  • update(key: Key, changes: object): Promise<number>
  • Parameters

    • key: Key
    • changes: object
      • [keyPath: string]: any

    Returns Promise<number>

where

  • where(index: string | string[]): WhereClause<T, Key>
  • where(equalityCriterias: object): Collection<T, Key>
  • Parameters

    • index: string | string[]

    Returns WhereClause<T, Key>

  • Parameters

    • equalityCriterias: object
      • [key: string]: IndexableType

    Returns Collection<T, Key>

Transaction

Transaction: object

Type declaration

active

active: boolean

db

db: Dexie

idbtrans

idbtrans: IDBTransaction

mode

mode: string

on

on: TransactionEvents

storeNames

storeNames: Array<string>

tables

tables: object

Type declaration

  • [type: string]: Table<any, any>

abort

  • abort(): void
  • Returns void

table

  • table(tableName: string): Table<any, any>
  • table<T>(tableName: string): Table<T, any>
  • table<T, Key>(tableName: string): Table<T, Key>
  • Parameters

    • tableName: string

    Returns Table<any, any>

  • Type parameters

    • T

    Parameters

    • tableName: string

    Returns Table<T, any>

  • Type parameters

    • T

    • Key

    Parameters

    • tableName: string

    Returns Table<T, Key>

Version

Version: object

Type declaration

stores

  • stores(schema: object): Version
  • Parameters

    • schema: object
      • [key: string]: string | null

    Returns Version

upgrade

  • upgrade(fn: function): Version
  • Parameters

    • fn: function
        • (trans: Transaction): void
        • Parameters

          • trans: Transaction

          Returns void

    Returns Version

WhereClause

WhereClause: object

Type declaration

above

  • above(key: IndexableType): Collection<T, Key>
  • Parameters

    • key: IndexableType

    Returns Collection<T, Key>

aboveOrEqual

  • aboveOrEqual(key: IndexableType): Collection<T, Key>
  • Parameters

    • key: IndexableType

    Returns Collection<T, Key>

anyOf

  • anyOf(keys: IndexableTypeArrayReadonly): Collection<T, Key>
  • anyOf(...keys: IndexableTypeArray): Collection<T, Key>
  • Parameters

    • keys: IndexableTypeArrayReadonly

    Returns Collection<T, Key>

  • Parameters

    • Rest ...keys: IndexableTypeArray

    Returns Collection<T, Key>

anyOfIgnoreCase

  • anyOfIgnoreCase(keys: string[]): Collection<T, Key>
  • anyOfIgnoreCase(...keys: string[]): Collection<T, Key>
  • Parameters

    • keys: string[]

    Returns Collection<T, Key>

  • Parameters

    • Rest ...keys: string[]

    Returns Collection<T, Key>

below

  • below(key: IndexableType): Collection<T, Key>
  • Parameters

    • key: IndexableType

    Returns Collection<T, Key>

belowOrEqual

  • belowOrEqual(key: IndexableType): Collection<T, Key>
  • Parameters

    • key: IndexableType

    Returns Collection<T, Key>

between

  • between(lower: IndexableType, upper: IndexableType, includeLower?: undefined | false | true, includeUpper?: undefined | false | true): Collection<T, Key>
  • Parameters

    • lower: IndexableType
    • upper: IndexableType
    • Optional includeLower: undefined | false | true
    • Optional includeUpper: undefined | false | true

    Returns Collection<T, Key>

equals

  • equals(key: IndexableType): Collection<T, Key>
  • Parameters

    • key: IndexableType

    Returns Collection<T, Key>

equalsIgnoreCase

  • equalsIgnoreCase(key: string): Collection<T, Key>
  • Parameters

    • key: string

    Returns Collection<T, Key>

inAnyRange

  • inAnyRange(ranges: Array<IndexableTypeArrayReadonly>): Collection<T, Key>
  • Parameters

    • ranges: Array<IndexableTypeArrayReadonly>

    Returns Collection<T, Key>

noneOf

  • noneOf(keys: Array<IndexableType>): Collection<T, Key>
  • Parameters

    • keys: Array<IndexableType>

    Returns Collection<T, Key>

notEqual

  • notEqual(key: IndexableType): Collection<T, Key>
  • Parameters

    • key: IndexableType

    Returns Collection<T, Key>

startsWith

  • startsWith(key: string): Collection<T, Key>
  • Parameters

    • key: string

    Returns Collection<T, Key>

startsWithAnyOf

  • startsWithAnyOf(prefixes: string[]): Collection<T, Key>
  • startsWithAnyOf(...prefixes: string[]): Collection<T, Key>
  • Parameters

    • prefixes: string[]

    Returns Collection<T, Key>

  • Parameters

    • Rest ...prefixes: string[]

    Returns Collection<T, Key>

startsWithAnyOfIgnoreCase

  • startsWithAnyOfIgnoreCase(prefixes: string[]): Collection<T, Key>
  • startsWithAnyOfIgnoreCase(...prefixes: string[]): Collection<T, Key>
  • Parameters

    • prefixes: string[]

    Returns Collection<T, Key>

  • Parameters

    • Rest ...prefixes: string[]

    Returns Collection<T, Key>

startsWithIgnoreCase

  • startsWithIgnoreCase(key: string): Collection<T, Key>
  • Parameters

    • key: string

    Returns Collection<T, Key>

clipItems

clipItems: Table<ClipItem, number>

ClipItems table

labels

labels: Table<Label, number>

Labels table

name

name: string

on

on: DbEvents

tables

tables: Table<any, any>[]

verno

verno: number

Static Events

Events: any

Static IndexSpec

IndexSpec: object

Type declaration

Static Promise

Promise: DexiePromiseConstructor

Static TableSchema

TableSchema: object

Type declaration

Static addons

addons: Array<function>

Static currentTransaction

currentTransaction: Transaction

Static default

default: Dexie

Static dependencies

dependencies: object

Type declaration

  • IDBKeyRange: IDBKeyRange
  • indexedDB: IDBFactory

Static errnames

errnames: object

Type declaration

  • Abort: "AbortError"
  • Constraint: "ConstraintError"
  • Data: "DataError"
  • DataClone: "DataCloneError"
  • DatabaseClosed: "DatabaseClosedError"
  • Internal: "InternalError"
  • InvalidAccess: "InvalidAccessError"
  • InvalidArgument: "InvalidArgumentError"
  • InvalidState: "InvalidStateError"
  • InvalidTable: "InvalidTableError"
  • MissingAPI: "MissingAPIError"
  • Modify: "ModifyError"
  • NoSuchDatabase: "NoSuchDatabaseError"
  • NotFound: "NotFoundError"
  • OpenFailed: "OpenFailedError"
  • QuotaExceeded: "QuotaExceededError"
  • ReadOnly: "ReadOnlyError"
  • Schema: "SchemaError"
  • SubTransaction: "Error"
  • Syntax: "SyntaxError"
  • Timeout: "TimeoutError"
  • TransactionInactive: "TransactionInactiveError"
  • Unknown: "UnknownError"
  • Unsupported: "UnsupportedError"
  • Upgrade: "UpgradeError"
  • Version: "VersionError"
  • VersionChange: "VersionChangeError"

Static maxKey

maxKey: Array<Array<void>> | string

Static minKey

minKey: number

Static semVer

semVer: string

Static version

version: number

Methods

backendDB

  • backendDB(): IDBDatabase
  • Returns IDBDatabase

close

  • close(): void
  • Returns void

delete

  • delete(): Promise<void>
  • Returns Promise<void>

dynamicallyOpened

  • dynamicallyOpened(): boolean
  • Returns boolean

hasBeenClosed

  • hasBeenClosed(): boolean
  • Returns boolean

hasFailed

  • hasFailed(): boolean
  • Returns boolean

isOpen

  • isOpen(): boolean
  • Returns boolean

open

  • open(): Promise<Dexie>
  • Returns Promise<Dexie>

table

  • table(tableName: string): Table<any, any>
  • table<T>(tableName: string): Table<T, any>
  • table<T, Key>(tableName: string): Table<T, Key>
  • Parameters

    • tableName: string

    Returns Table<any, any>

  • Type parameters

    • T

    Parameters

    • tableName: string

    Returns Table<T, any>

  • Type parameters

    • T

    • Key

    Parameters

    • tableName: string

    Returns Table<T, Key>

transaction

  • transaction<U>(mode: TransactionMode, table: Table<any, any>, scope: function): Promise<U>
  • transaction<U>(mode: TransactionMode, table: Table<any, any>, table2: Table<any, any>, scope: function): Promise<U>
  • transaction<U>(mode: TransactionMode, table: Table<any, any>, table2: Table<any, any>, table3: Table<any, any>, scope: function): Promise<U>
  • transaction<U>(mode: TransactionMode, table: Table<any, any>, table2: Table<any, any>, table3: Table<any, any>, table4: Table<any, any>, scope: function): Promise<U>
  • transaction<U>(mode: TransactionMode, table: Table<any, any>, table2: Table<any, any>, table3: Table<any, any>, table4: Table<any, any>, table5: Table<any, any>, scope: function): Promise<U>
  • transaction<U>(mode: TransactionMode, tables: Table<any, any>[], scope: function): Promise<U>
  • Type parameters

    • U

    Parameters

    • mode: TransactionMode
    • table: Table<any, any>
    • scope: function
        • (): PromiseLike<U> | U
        • Returns PromiseLike<U> | U

    Returns Promise<U>

  • Type parameters

    • U

    Parameters

    • mode: TransactionMode
    • table: Table<any, any>
    • table2: Table<any, any>
    • scope: function
        • (): PromiseLike<U> | U
        • Returns PromiseLike<U> | U

    Returns Promise<U>

  • Type parameters

    • U

    Parameters

    • mode: TransactionMode
    • table: Table<any, any>
    • table2: Table<any, any>
    • table3: Table<any, any>
    • scope: function
        • (): PromiseLike<U> | U
        • Returns PromiseLike<U> | U

    Returns Promise<U>

  • Type parameters

    • U

    Parameters

    • mode: TransactionMode
    • table: Table<any, any>
    • table2: Table<any, any>
    • table3: Table<any, any>
    • table4: Table<any, any>
    • scope: function
        • (): PromiseLike<U> | U
        • Returns PromiseLike<U> | U

    Returns Promise<U>

  • Type parameters

    • U

    Parameters

    • mode: TransactionMode
    • table: Table<any, any>
    • table2: Table<any, any>
    • table3: Table<any, any>
    • table4: Table<any, any>
    • table5: Table<any, any>
    • scope: function
        • (): PromiseLike<U> | U
        • Returns PromiseLike<U> | U

    Returns Promise<U>

  • Type parameters

    • U

    Parameters

    • mode: TransactionMode
    • tables: Table<any, any>[]
    • scope: function
        • (): PromiseLike<U> | U
        • Returns PromiseLike<U> | U

    Returns Promise<U>

version

  • version(versionNumber: Number): Version
  • Parameters

    • versionNumber: Number

    Returns Version

vip

  • vip<U>(scopeFunction: function): U
  • Type parameters

    • U

    Parameters

    • scopeFunction: function
        • (): U
        • Returns U

    Returns U

Static asap

  • asap(fn: Function): void
  • Parameters

    • fn: Function

    Returns void

Static deepClone

  • deepClone<T>(obj: T): T
  • Type parameters

    • T

    Parameters

    • obj: T

    Returns T

Static delByKeyPath

  • delByKeyPath(obj: Object, keyPath: string): void
  • Parameters

    • obj: Object
    • keyPath: string

    Returns void

Static delete

  • delete(dbName: string): Promise<void>
  • Parameters

    • dbName: string

    Returns Promise<void>

Static exists

  • exists(dbName: string): Promise<boolean>
  • Parameters

    • dbName: string

    Returns Promise<boolean>

Static getByKeyPath

  • getByKeyPath(obj: Object, keyPath: string): any
  • Parameters

    • obj: Object
    • keyPath: string

    Returns any

Static getDatabaseNames

  • getDatabaseNames(): Promise<string[]>
  • getDatabaseNames<R>(thenShortcut: ThenShortcut<string[], R>): Promise<R>
  • Returns Promise<string[]>

  • Type parameters

    • R

    Parameters

    • thenShortcut: ThenShortcut<string[], R>

    Returns Promise<R>

Static override

  • override<F>(origFunc: F, overridedFactory: function): F
  • Type parameters

    • F

    Parameters

    • origFunc: F
    • overridedFactory: function
        • (fn: any): any
        • Parameters

          • fn: any

          Returns any

    Returns F

Static setByKeyPath

  • setByKeyPath(obj: Object, keyPath: string, value: any): void
  • Parameters

    • obj: Object
    • keyPath: string
    • value: any

    Returns void

Static shallowClone

  • shallowClone<T>(obj: T): T
  • Type parameters

    • T

    Parameters

    • obj: T

    Returns T

Static waitFor

  • waitFor<T>(promise: PromiseLike<T> | T): Promise<T>
  • waitFor<T>(promise: PromiseLike<T> | T, timeoutMilliseconds: number): Promise<T>
  • Type parameters

    • T

    Parameters

    • promise: PromiseLike<T> | T

    Returns Promise<T>

  • Type parameters

    • T

    Parameters

    • promise: PromiseLike<T> | T
    • timeoutMilliseconds: number

    Returns Promise<T>

Generated using TypeDoc