Table of Contents

Class MDSQLiteAdapter

Namespace
PowerSync.Common.MDSQLite
Assembly
PowerSync.Common.dll
public class MDSQLiteAdapter : IDBAdapter, ILockContext, IDBGetUtils, ICloseableAsync
Inheritance
MDSQLiteAdapter
Implements
Inherited Members

Constructors

MDSQLiteAdapter(MDSQLiteAdapterOptions)

Fields

options
resolvedOptions

Properties

Events

The event manager for the adapter.

Name

The name of the adapter.

Methods

Close()

Closes the adapter.

Execute(string, object?[]?)
ExecuteBatch(string, object?[][]?)
Get(string, object?[]?)

Executes a read-only query and returns the first row. Throws if there are no rows.

GetAll(string, object?[]?)

Executes a read-only query and returns all rows.

GetAll<T>(string, object?[]?)

Executes a read-only query and returns all rows, mapped using T.FromRow.

GetAll<T>(string, object?[]?, SqlMapper<T>)

Executes a read-only query and returns all rows, mapped using mapper.

GetOptional(string, object?[]?)

Executes a read-only query and returns the first row, or null if there are no rows.

GetOptional<T>(string, object?[]?)

Executes a read-only query and returns the first row mapped using T.FromRow, or default(T) if there are no rows. Note that default(T) is not null if T is a value type.

GetOptional<T>(string, object?[]?, SqlMapper<T>)

Executes a read-only query and returns the first row mapped using mapper, or default(T) if there are no rows. Note that default(T) is not null for all types. Map to a nullable type (e.g. row => (long?)row.GetLong("id")) to ensure you get null.

Get<T>(string, object?[]?)

Executes a read-only query and returns the first row mapped using T.FromRow. Throws if there are no rows.

Get<T>(string, object?[]?, SqlMapper<T>)

Executes a read-only query and returns the first row mapped using mapper. Throws if there are no rows.

InternalTransaction(MDSQLiteTransaction, Func<ITransaction, Task>)
InternalTransaction<T>(MDSQLiteTransaction, Func<ITransaction, Task<T>>)
LoadDefaultPowerSyncExtension(SqliteConnection)

Loads the bundled PowerSync core SQLite extension. Override on platform-specific adapters where the native library lives outside the standard runtimes path.

LoadExtensions(SqliteConnection)
OpenConnection(string)
ReadLock<T>(Func<ILockContext, Task<T>>, DBLockOptions?)

Executes a read lock with the given function.

ReadTransaction<T>(Func<ITransaction, Task<T>>, DBLockOptions?)

Executes a read transaction with the given function.

RefreshSchema()

This method refreshes the schema information across all connections. This is for advanced use cases, and should generally not be needed.

WriteLock(Func<ILockContext, Task>, DBLockOptions?)

Executes a write lock with the given function.

WriteLock<T>(Func<ILockContext, Task<T>>, DBLockOptions?)

Executes a write lock with the given function.

WriteTransaction(Func<ITransaction, Task>, DBLockOptions?)

Executes a write transaction with the given function.

WriteTransaction<T>(Func<ITransaction, Task<T>>, DBLockOptions?)

Executes a write transaction with the given function.