@ovok/native/bluetooth/sqlite

The outbox store on `expo-sqlite`, for an app that builds its own instead of passing `sqlite` to the `Ovok` client.

  • Stable unknown
  • Release candidate not available
  • Development since 1.17.0-dev.2305+58d9b20

The outbox store on expo-sqlite, for an app that builds its own instead of passing sqlite to the Ovok client. Import from @ovok/native/bluetooth/sqlite. It has its own subpath so apps without expo-sqlite, and browser bundles, never load it.

Classes

SqliteOutboxStore

The outbox store on expo-sqlite, for phones; expo-sqlite is an optional peer dependency, loaded on first use.

Extends

  • SqliteDatabaseOutboxStore

Constructors

Constructor
new SqliteOutboxStore(options?): SqliteOutboxStore;
Parameters
ParameterType
options?SqliteOutboxOptions
Returns

SqliteOutboxStore

Overrides

SqliteDatabaseOutboxStore.constructor

Methods

count()
count(ownerKey, state): Promise<number>;

How many of the owner's items are in state.

Parameters
ParameterType
ownerKeystring
stateOutboxState
Returns

Promise<number>

Inherited from

SqliteDatabaseOutboxStore.count

due()
due(
   ownerKey,
   now,
   limit
): Promise<OutboxItem[]>;

The owner's pending items that are due, newest recorded first, then by position in the recording.

Parameters
ParameterType
ownerKeystring
nownumber
limitnumber
Returns

Promise<OutboxItem[]>

Inherited from

SqliteDatabaseOutboxStore.due

get()
get(id): Promise<OutboxItem | null>;

Returns an item, or null when there is none.

Parameters
ParameterType
idstring
Returns

Promise<OutboxItem | null>

Inherited from

SqliteDatabaseOutboxStore.get

put()
put(item): Promise<void>;

Stores an item, replacing the one with the same id.

Parameters
ParameterType
itemOutboxItem
Returns

Promise<void>

Inherited from

SqliteDatabaseOutboxStore.put

remove()
remove(id): Promise<void>;

Deletes an item; an unknown id is not an error.

Parameters
ParameterType
idstring
Returns

Promise<void>

Inherited from

SqliteDatabaseOutboxStore.remove

summaries()
summaries(ownerKey): Promise<OutboxItemSummary[]>;

Every item of the owner in any state, newest recorded first, without its entries.

Parameters
ParameterType
ownerKeystring
Returns

Promise<OutboxItemSummary[]>

Inherited from

SqliteDatabaseOutboxStore.summaries

Interfaces

SqliteDatabase

The part of an expo-sqlite database the outbox store uses.

Extends

Methods

execAsync()
execAsync(source): Promise<void>;

Runs statements that take no parameters.

Parameters
ParameterType
sourcestring
Returns

Promise<void>

Inherited from

SqliteTransaction.execAsync

getAllAsync()
getAllAsync<Row>(source, params): Promise<Row[]>;

Returns every row a query finds.

Type Parameters
Type Parameter
Row
Parameters
ParameterType
sourcestring
paramsSqliteBindValue[]
Returns

Promise<Row[]>

getFirstAsync()
getFirstAsync<Row>(source, params): Promise<Row | null>;

Returns the first row a query finds, or null.

Type Parameters
Type Parameter
Row
Parameters
ParameterType
sourcestring
paramsSqliteBindValue[]
Returns

Promise<Row | null>

Inherited from

SqliteTransaction.getFirstAsync

runAsync()
runAsync(source, params): Promise<unknown>;

Runs one statement that writes.

Parameters
ParameterType
sourcestring
paramsSqliteBindValue[]
Returns

Promise<unknown>

Inherited from

SqliteTransaction.runAsync

withExclusiveTransactionAsync()
withExclusiveTransactionAsync(task): Promise<void>;

Runs task in one exclusive transaction: it commits when task resolves and rolls back when it throws.

Parameters
ParameterType
task(transaction) => Promise<void>
Returns

Promise<void>


SqliteTransaction

The part of an expo-sqlite transaction the outbox store uses.

Extended by

Methods

execAsync()
execAsync(source): Promise<void>;

Runs statements that take no parameters.

Parameters
ParameterType
sourcestring
Returns

Promise<void>

getFirstAsync()
getFirstAsync<Row>(source, params): Promise<Row | null>;

Returns the first row a query finds, or null.

Type Parameters
Type Parameter
Row
Parameters
ParameterType
sourcestring
paramsSqliteBindValue[]
Returns

Promise<Row | null>

runAsync()
runAsync(source, params): Promise<unknown>;

Runs one statement that writes.

Parameters
ParameterType
sourcestring
paramsSqliteBindValue[]
Returns

Promise<unknown>

Type Aliases

SqliteBindValue

type SqliteBindValue = string | number | null;

A value SQLite binds to a ? placeholder.


SqliteDatabaseOutboxOptions

type SqliteDatabaseOutboxOptions = object;

How SqliteDatabaseOutboxStore opens its database.

Properties

logger?
logger?: Logger;

Where structured events go; silent by default.

name?
name?: string;

The database file name; ovok-outbox.db by default.

open
open: (name) => Promise<SqliteDatabase>;

Opens the named database, such as expo-sqlite's openDatabaseAsync.

Parameters
ParameterType
namestring
Returns

Promise<SqliteDatabase>


SqliteOutboxOptions

type SqliteOutboxOptions = Partial<SqliteDatabaseOutboxOptions>;

Every field has a default for a phone app; open defaults to expo-sqlite's openDatabaseAsync.

References

OvokSqlite

Re-exports OvokSqlite

Last updated on

On this page