CapacitorSQLiteAdapter
Experimental Alpha
An implementation of DBAdapter using the Capacitor Community SQLite plugin.
This is currently experimental and may change without a major version bump.
Extends
DBAdapter
Constructors
new CapacitorSQLiteAdapter()
new CapacitorSQLiteAdapter(options): CapacitorSQLiteAdapter
Alpha Experimental
Parameters
| Parameter | Type |
|---|---|
options | CapacitorSQLiteOpenFactoryOptions |
Returns
Overrides
DBAdapter.constructor
Accessors
name
Get Signature
get name(): string
Alpha Experimental
Returns
string
Overrides
DBAdapter.name
Methods
close()
close(): Promise<void>
Alpha Experimental
Returns
Promise<void>
Overrides
DBAdapter.close
dispose()
dispose(): void
Alpha Experimental
Returns
void
Inherited from
DBAdapter.dispose
execute()
execute<T>(query, params?): Promise<QueryResult<T>>
Alpha
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
query | string |
params? | any[] |
Returns
Promise<QueryResult<T>>
The query result as an object with structured key-value pairs
Inherited from
DBAdapter.execute
executeBatch()
executeBatch(query, params?): Promise<QueryResult<never>>
Alpha
Parameters
| Parameter | Type |
|---|---|
query | string |
params? | any[][] |
Returns
Promise<QueryResult<never>>
The query result
Inherited from
DBAdapter.executeBatch
executeRaw()
executeRaw(query, params?): Promise<RawQueryResult>
Alpha
Parameters
| Parameter | Type |
|---|---|
query | string |
params? | any[] |
Returns
Promise<RawQueryResult>
The RawQueryResult representing each row as an array.
Inherited from
DBAdapter.executeRaw
get()
get<T>(sql, parameters?): Promise<T>
Alpha
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
sql | string | The SQL query to execute |
parameters? | any[] | Optional array of parameters to bind to the query |
Returns
Promise<T>
The first result matching the query
Throws
Error if no rows are returned
Inherited from
DBAdapter.get
getAll()
getAll<T>(sql, parameters?): Promise<T[]>
Alpha
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
sql | string | The SQL query to execute |
parameters? | any[] | Optional array of parameters to bind to the query |
Returns
Promise<T[]>
An array of results
Inherited from
DBAdapter.getAll
getOptional()
getOptional<T>(sql, parameters?): Promise<null | T>
Alpha
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
sql | string | The SQL query to execute |
parameters? | any[] | Optional array of parameters to bind to the query |
Returns
Promise<null | T>
The first result if found, or null if no results are returned
Inherited from
DBAdapter.getOptional
iterateAsyncListeners()
iterateAsyncListeners(cb): Promise<void>
Alpha Experimental
Parameters
| Parameter | Type |
|---|---|
cb | (listener) => Promise<any> |
Returns
Promise<void>
Inherited from
DBAdapter.iterateAsyncListeners
iterateListeners()
iterateListeners(cb): void
Alpha Experimental
Parameters
| Parameter | Type |
|---|---|
cb | (listener) => any |
Returns
void
Inherited from
DBAdapter.iterateListeners
readLock()
readLock<T>(fn, options?): Promise<T>
Alpha Experimental
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | (tx) => Promise<T> |
options? | DBLockOptions |
Returns
Promise<T>
Overrides
DBAdapter.readLock
readTransaction()
readTransaction<T>(fn, options?): Promise<T>
Alpha Experimental
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | (tx) => Promise<T> |
options? | DBLockOptions |
Returns
Promise<T>
Inherited from
DBAdapter.readTransaction
refreshSchema()
refreshSchema(): Promise<void>
Alpha
Returns
Promise<void>
Overrides
DBAdapter.refreshSchema
registerListener()
registerListener(listener): () => void
Alpha
Parameters
| Parameter | Type |
|---|---|
listener | Partial<DBAdapterListener> |
Returns
Function
Returns
void
Inherited from
DBAdapter.registerListener
writeLock()
writeLock<T>(fn, options?): Promise<T>
Alpha Experimental
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | (tx) => Promise<T> |
options? | DBLockOptions |
Returns
Promise<T>
Overrides
DBAdapter.writeLock
writeTransaction()
writeTransaction<T>(fn, options?): Promise<T>
Alpha Experimental
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
fn | (tx) => Promise<T> |
options? | DBLockOptions |
Returns
Promise<T>
Inherited from
DBAdapter.writeTransaction