The PowerSync Client SDKs expose a managed SQLite database that your app can read from and write to. The client-side schema refers to the schema for that SQLite database.

The client-side schema is typically mainly derived from your backend database schema and Sync Rules, but can also include other tables such as local-only tables.

Note that schema migrations are not required on the SQLite database due to the schemaless nature of the PowerSync protocol: schemaless data is synced to the client-side SQLite database, and the client-side schema is then applied to that data using SQLite views to allow for structured querying of the data.

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 other languages is coming soon.

Similar functionality exists in the PowerSync CLI.

Note: The generated schema will exclude an 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

Node.js (alpha)

.NET (alpha)

ORM Support

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

Next Step

The next step is to instantiate the client-side PowerSync database:

Instantiate the PowerSync Database →