Skip to main content

WASQLiteDBAdapter

Adapter for WA-SQLite SQLite connections.

Extends

Implements

Constructors

new WASQLiteDBAdapter()

new WASQLiteDBAdapter(options): WASQLiteDBAdapter

Parameters

ParameterType
optionsWASQLiteDBAdapterOptions

Returns

WASQLiteDBAdapter

Overrides

BaseObserver.constructor

Accessors

name

get name(): string

Returns

string

Methods

close()

close(): void

Attempts to close the connection. Shared workers might not actually close the connection if other tabs are still using it.

Returns

void

Implementation of

DBAdapter.close


execute()

execute(query, params?): Promise<QueryResult>

Parameters

ParameterType
querystring
params?any[]

Returns

Promise<QueryResult>

Implementation of

DBAdapter.execute


executeBatch()

executeBatch(query, params?): Promise<QueryResult>

Parameters

ParameterType
querystring
params?any[][]

Returns

Promise<QueryResult>

Implementation of

DBAdapter.executeBatch


get()

get<T>(sql, parameters?): Promise<T>

Execute a read-only query and return the first result, error if the ResultSet is empty.

Type parameters

Type parameter
T

Parameters

ParameterType
sqlstring
parameters?any[]

Returns

Promise<T>

Implementation of

DBAdapter.get


getAll()

getAll<T>(sql, parameters?): Promise<T[]>

Execute a read-only query and return results.

Type parameters

Type parameter
T

Parameters

ParameterType
sqlstring
parameters?any[]

Returns

Promise<T[]>

Implementation of

DBAdapter.getAll


getOptional()

getOptional<T>(sql, parameters?): Promise<null | T>

Execute a read-only query and return the first result, or null if the ResultSet is empty.

Type parameters

Type parameter
T

Parameters

ParameterType
sqlstring
parameters?any[]

Returns

Promise<null | T>

Implementation of

DBAdapter.getOptional


getWorker()

getWorker(): void

Returns

void


iterateAsyncListeners()

iterateAsyncListeners(cb): Promise<void>

Parameters

ParameterType
cb(listener) => Promise<any>

Returns

Promise<void>

Inherited from

BaseObserver.iterateAsyncListeners


iterateListeners()

iterateListeners(cb): void

Parameters

ParameterType
cb(listener) => any

Returns

void

Inherited from

BaseObserver.iterateListeners


readLock()

readLock<T>(fn, options?): Promise<T>

Type parameters

Type parameter
T

Parameters

ParameterType
fn(tx) => Promise<T>
options?DBLockOptions

Returns

Promise<T>

Implementation of

DBAdapter.readLock


readTransaction()

readTransaction<T>(fn, options?): Promise<T>

Type parameters

Type parameter
T

Parameters

ParameterType
fn(tx) => Promise<T>
options?DBLockOptions

Returns

Promise<T>

Implementation of

DBAdapter.readTransaction


refreshSchema()

refreshSchema(): Promise<void>

Returns

Promise<void>

Implementation of

DBAdapter.refreshSchema


registerListener()

registerListener(listener): () => void

Register a listener for updates to the PowerSync client.

Parameters

ParameterType
listenerPartial<DBAdapterListener>

Returns

Function

Returns

void

Implementation of

DBAdapter.registerListener

Inherited from

BaseObserver.registerListener


writeLock()

writeLock<T>(fn, options?): Promise<T>

Type parameters

Type parameter
T

Parameters

ParameterType
fn(tx) => Promise<T>
options?DBLockOptions

Returns

Promise<T>

Implementation of

DBAdapter.writeLock


writeTransaction()

writeTransaction<T>(fn, options?): Promise<T>

Type parameters

Type parameter
T

Parameters

ParameterType
fn(tx) => Promise<T>
options?DBLockOptions

Returns

Promise<T>

Implementation of

DBAdapter.writeTransaction