Full SDK reference for using PowerSync in Flutter/Dart clients
schema
parameter to the PowerSyncDatabase constructor.
This schema represents a “view” of the downloaded data. No migrations are required — the schema is applied directly when the PowerSync database is constructed.
text
, integer
and real
. These should map directly to the values produced by the Sync Rules. If a value doesn’t match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on Types in the Sync Rules documentation.
Example:
id
column, as PowerSync will automatically create this.PowerSyncDatabase
, inject the Schema you defined in the previous step and a file path — it’s important to only instantiate one instance of PowerSyncDatabase
per file.
Example:
TodoList
model class that represents a List of todos.
null
if no result is found).
The following is an example of selecting a list item by ID