Skip to main content

PocketSyncDatabase

In our Flutter SDK, PocketSyncDatabase is a wrapper around sqflite database. Our Typescript SDK (planned) will use sql.js.

Usage

PocketSyncDatabase is initialized with PocketSync instance. You can access it via PocketSync.instance.database.

CRUD Operations

PocketSyncDatabase provides simple methods for performing CRUD (Create, Read, Update, Delete) operations on your data.

Create

Read

Update

Delete

Transactions

Batch operations

Raw SQL

Watch changes

Supported datatypes

PocketSyncDatabase does not support the following datatypes:
  • DateTime is not a supported SQLite type. Use INTEGER and millisSinceEpoch values.
  • bool is not a supported SQLite type. Use INTEGER and 0 and 1 values.

Learn more

PocketSyncDatabase is a wrapper around sqflite, hence it supports all the features of sqflite and shares their limitations.