Define your Schema

You need to set up your 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 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 CLI.

Example implementation

For an example implementation of the client-side schema, see the Getting Started section of the SDK reference for your platform:

ORM Support

For details on ORM support in PowerSync, refer to Using ORMs with PowerSync on our blog.

Last updated