WASQLiteDBAdapter
Adapter for WA-SQLite SQLite connections.
Extends
Implements
Constructors
new WASQLiteDBAdapter()
new WASQLiteDBAdapter(options): WASQLiteDBAdapter
Parameters
Parameter | Type |
---|---|
options | WASQLiteDBAdapterOptions |
Returns
Overrides
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
Parameter | Type |
---|---|
query | string |
params ? | any [] |
Returns
Promise
<QueryResult
>
Implementation of
DBAdapter
.execute
executeBatch()
executeBatch(query, params?): Promise<QueryResult>
Parameters
Parameter | Type |
---|---|
query | string |
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
Parameter | Type |
---|---|
sql | string |
parameters ? | any [] |
Returns
Promise
<T
>
Implementation of
getAll()
getAll<T>(sql, parameters?): Promise<T[]>
Execute a read-only query and return results.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
sql | string |
parameters ? | any [] |
Returns
Promise
<T
[]>
Implementation of
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
Parameter | Type |
---|---|
sql | string |
parameters ? | any [] |
Returns
Promise
<null
| T
>
Implementation of
getWorker()
getWorker(): void
Returns
void
iterateAsyncListeners()
iterateAsyncListeners(cb): Promise<void>
Parameters
Parameter | Type |
---|---|
cb | (listener ) => Promise <any > |
Returns
Promise
<void
>
Inherited from
BaseObserver
.iterateAsyncListeners
iterateListeners()
iterateListeners(cb): void
Parameters
Parameter | Type |
---|---|
cb | (listener ) => any |
Returns
void
Inherited from
readLock()
readLock<T>(fn, options?): Promise<T>
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
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
Parameter | Type |
---|---|
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
Parameter | Type |
---|---|
listener | Partial <DBAdapterListener > |
Returns
Function
Returns
void
Implementation of
Inherited from
writeLock()
writeLock<T>(fn, options?): Promise<T>
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
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
Parameter | Type |
---|---|
fn | (tx ) => Promise <T > |
options ? | DBLockOptions |
Returns
Promise
<T
>
Implementation of
DBAdapter
.writeTransaction