@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
| Parameter | Type |
|---|---|
options? | SqliteOutboxOptions |
Returns
Overrides
SqliteDatabaseOutboxStore.constructor
Methods
count()
count(ownerKey, state): Promise<number>;How many of the owner's items are in state.
Parameters
| Parameter | Type |
|---|---|
ownerKey | string |
state | OutboxState |
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
| Parameter | Type |
|---|---|
ownerKey | string |
now | number |
limit | number |
Returns
Promise<OutboxItem[]>
Inherited from
SqliteDatabaseOutboxStore.due
get()
get(id): Promise<OutboxItem | null>;Returns an item, or null when there is none.
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<OutboxItem | null>
Inherited from
SqliteDatabaseOutboxStore.get
put()
put(item): Promise<void>;Stores an item, replacing the one with the same id.
Parameters
| Parameter | Type |
|---|---|
item | OutboxItem |
Returns
Promise<void>
Inherited from
SqliteDatabaseOutboxStore.put
remove()
remove(id): Promise<void>;Deletes an item; an unknown id is not an error.
Parameters
| Parameter | Type |
|---|---|
id | string |
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
| Parameter | Type |
|---|---|
ownerKey | string |
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
| Parameter | Type |
|---|---|
source | string |
Returns
Promise<void>
Inherited from
getAllAsync()
getAllAsync<Row>(source, params): Promise<Row[]>;Returns every row a query finds.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
source | string |
params | SqliteBindValue[] |
Returns
Promise<Row[]>
getFirstAsync()
getFirstAsync<Row>(source, params): Promise<Row | null>;Returns the first row a query finds, or null.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
source | string |
params | SqliteBindValue[] |
Returns
Promise<Row | null>
Inherited from
SqliteTransaction.getFirstAsync
runAsync()
runAsync(source, params): Promise<unknown>;Runs one statement that writes.
Parameters
| Parameter | Type |
|---|---|
source | string |
params | SqliteBindValue[] |
Returns
Promise<unknown>
Inherited from
withExclusiveTransactionAsync()
withExclusiveTransactionAsync(task): Promise<void>;Runs task in one exclusive transaction: it commits when task resolves and rolls back when it throws.
Parameters
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
source | string |
Returns
Promise<void>
getFirstAsync()
getFirstAsync<Row>(source, params): Promise<Row | null>;Returns the first row a query finds, or null.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
source | string |
params | SqliteBindValue[] |
Returns
Promise<Row | null>
runAsync()
runAsync(source, params): Promise<unknown>;Runs one statement that writes.
Parameters
| Parameter | Type |
|---|---|
source | string |
params | SqliteBindValue[] |
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
| Parameter | Type |
|---|---|
name | string |
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