Define your Schema
You need to set up your client-side schema in your app project. This involves defining your schema in code using the PowerSync syntax.
This schema represents a “view” of the downloaded data. No migrations are required — the schema is applied directly when the local PowerSync SQLite database is constructed.
Generate schema automatically (PowerSync Cloud)
In the PowerSync Dashboard, the schema can be generated based off your Sync Rules by right-clicking on an instance and selecting Generate client-side schema. Currently, the schema can be generated in JavaScript or Dart. Support for Kotlin is coming soon.
Similar functionality exists in the PowerSync CLI.
Note: The generated schema will exclude the id
column, as the client SDK automatically creates an id
column of type text
. Consequently, it is not necessary to specify an id
column in your schema. For additional information on IDs, refer to Client ID.
Example implementation
For an example implementation of the client-side schema, see the Getting Started section of the SDK reference for your platform:
Flutter
React Native & Expo
JavaScript Web
Kotlin Multiplatform
Swift
ORM Support
For details on ORM support in PowerSync, refer to Using ORMs with PowerSync on our blog.
Was this page helpful?