Table of Contents

Interface IPowerSyncDatabase

Namespace
PowerSync.Common.Client
Assembly
PowerSync.Common.dll
public interface IPowerSyncDatabase : ICloseableAsync
Inherited Members

Methods

Connect(IMutationUploader, PowerSyncConnectionOptions?)
Connect(IPowerSyncBackendConnector, PowerSyncConnectionOptions?)
Connect(string, IAuthenticator, IMutationUploader?, PowerSyncConnectionOptions?)
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.

GetClientId()
GetCrudBatch(int)
GetNextCrudTransaction()
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.

ReadLock<T>(Func<ILockContext, Task<T>>, DBLockOptions?)
ReadTransaction<T>(Func<ITransaction, Task<T>>, DBLockOptions?)
SyncStream(string, Dictionary<string, object>?)
WriteLock(Func<ILockContext, Task>, DBLockOptions?)
WriteLock<T>(Func<ILockContext, Task<T>>, DBLockOptions?)
WriteTransaction(Func<ITransaction, Task>, DBLockOptions?)
WriteTransaction<T>(Func<ITransaction, Task<T>>, DBLockOptions?)