Use this file to discover all available pages before exploring further.
ORM support is available via the following package (currently in a beta release):
drift_sqlite_async | Dart package
This package enables using the Drift persistence library (ORM) with the PowerSync Dart/Flutter SDK. The Drift integration gives Flutter developers the flexibility to write queries in either Dart or SQL.Importantly, it supports propagating change notifications from the PowerSync side to Drift, which is necessary for streaming queries.The use of this package is recommended for Flutter developers who already know Drift, or specifically want the benefits of an ORM for their PowerSync projects.
Troubleshooting: Watch Streams with Local-Only Tables
When using local-only tables with a viewName that differs from the table name, Drift’s watch() streams may not receive update notifications. This happens because PowerSync sends notifications using the internal table name (e.g., local_items), but Drift is listening for the view name (e.g., items).Example problem:
// PowerSync schema with viewName overrideTable.localOnly( 'local_items', // Internal table name [...], viewName: 'items', // User-facing view name)
Solution: Use transformTableUpdates to map internal names to view names:
Other ORMs for Flutter, like Floor, are not currently supported. It is technically possible to open a separate connection to the same database file using Floor but there are two big caveats to that:Write locksEvery write transaction (or write statement) will lock the database for other writes for the duration of the transaction. While transactions are typically short, if multiple happen to run at the same time they may fail with a SQLITE_BUSY or similar error.External modificationsOften, ORMs only detect notifications made using the same library. In order to support streaming queries, PowerSync requires the ORM to allow external modifications to trigger the same change notifications, meaning streaming queries are unlikely to work out-of-the-box.