Skip to content

GenericPowerSyncService

GenericPowerSyncService(
tableName: String,
userId: String
)
@Published var records: [[String: Any]] // Loaded records
func loadRecords(
fields: [String] = ["*"],
whereClause: String? = nil,
parameters: [Any] = [],
orderBy: String = "created_at DESC",
encryptedFields: [String] = [],
integerFields: [String] = [],
booleanFields: [String] = []
) async throws
func createRecord(
fields: [String: Any],
encryptedFields: [String] = [],
autoGenerateId: Bool = true,
autoTimestamp: Bool = true
) async throws -> String
func createRecords(
records: [[String: Any]],
encryptedFields: [String] = [],
autoGenerateId: Bool = true,
autoTimestamp: Bool = true
) async throws -> [String]
func updateRecord(
id: String,
fields: [String: Any],
encryptedFields: [String] = [],
autoTimestamp: Bool = true
) async throws
func deleteRecord(id: String, caseInsensitive: Bool = true) async throws
func deleteRecords(ids: [String], caseInsensitive: Bool = true) async throws