> ## Documentation Index
> Fetch the complete documentation index at: https://docs.powersync.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Local-Only Usage

> Use PowerSync for local-only data persistence without backend sync or authentication.

In some of those cases, the user may want to register and start syncing data with other devices or users at a later point, while other users may keep on using the app without ever registering or going online."

PowerSync supports these scenarios. By default, all local changes will be stored in the upload queue, and will be uploaded to the backend server if the user registers at a later point.

A caveat is that if the user never registers, this queue will keep on growing in size indefinitely. For many applications this should be small enough to not be significant, but some data-intensive applications may want to avoid the indefinite queue growth.

There are two general approaches we recommend for this:

### 1. Local-only tables

<Tabs>
  <Tab title="Flutter">
    ```dart theme={null}
    final table = Table.localOnly(
      ...
    )
    ```

    <Note>
      **Flutter + Drift users:** If you're using local-only tables with `viewName` overrides, Drift's watch streams may not update correctly. See the [troubleshooting guide](/client-sdks/orms/flutter-orm-support#troubleshooting:-watch-streams-with-local-only-tables) for the solution.
    </Note>
  </Tab>

  <Tab title="JavaScript">
    ```js theme={null}
    const lists = new Table({
      ...
    }, {
      localOnly: true
    });
    ```
  </Tab>

  <Tab title="Kotlin">
    ```kotlin theme={null}
    val Table = Table(
        ...
        localOnly = true
    )
    ```
  </Tab>

  <Tab title="Swift">
    ```swift theme={null}
    let table = Table(
        ...
        localOnly: true
    )
    ```
  </Tab>

  <Tab title=".NET">
    ```csharp theme={null}
    public static Table Todos = new Table
    {
        Name = "todos",
        Columns =
        {
            // ... column definitions ...
        },
        LocalOnly = true
    };
    ```
  </Tab>

  <Tab title="Rust">
    Example not yet available.
  </Tab>
</Tabs>

Use local-only tables until the user has registered or signed in. This would not store any data in the upload queue, avoiding any overhead or growth in database size.

Once the user registers, move the data over to synced tables, at which point the data would be placed in the upload queue.

The following example implementations are available:

| Client framework                       | Link                                                                                                                                        |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Flutter To-Do List App (with Supabase) | [supabase-todolist-optional-sync](https://github.com/powersync-ja/powersync.dart/tree/main/demos/supabase-todolist-optional-sync)           |
| React To-Do List App (with Supabase)   | [react-supabase-todolist-optional-sync](https://github.com/powersync-ja/powersync-js/tree/main/demos/react-supabase-todolist-optional-sync) |

### 2. Clearing the upload queue

The upload queue can be cleared periodically (for example on every app start-up), avoiding the growth in database size over time. This can be done using:

```sql theme={null}
DELETE FROM ps_crud
```

It is up to the application to then re-create the queue when the user registers, or upload data directly from the existing tables instead.

A small amount of metadata per row is also stored in the `ps_oplog` table. We do not recommend deleting this data, as it can cause or hide consistency issues when later uploading the data. If the overhead in `ps_oplog` is too much, rather use the local-only tables approach.

### Local-only columns on synced tables

If you need individual local-only columns on a table that is otherwise synced (rather than an entirely local-only table), this can be achieved with [raw tables](/client-sdks/advanced/raw-tables#local-only-columns).
