flutterware
All guides
The running app

Database watch

Give the devbar a DatabaseAdapter and your app's database shows up as a panel while the app runs. You can browse the schema, run queries, keep a query live and follow writes, from the run's App tab, from fw run run or from an agent over MCP. It needs no rebuild, and it works on a physical phone, where the database file is inside the app sandbox and out of reach.

flutterware doesn't depend on any SQLite package. The adapter is four function types and a name, which you connect to the database library you already use.

The recipe: sqlite_async (and PowerSync)#

PowerSyncDatabase implements sqlite_async's interface, so the same code works for both. fixtures/probe_app/lib/devbar_example.dart has a working version.

import 'package:flutterware/devbar.dart';

Devbar(
  plugins: [
    DatabasePlugin.init(
      database: DatabaseAdapter(
        query: (sql, args) => db.getAll(sql, args),
        updates: db.updates.map((u) => u.tables),
        watch: (sql) =>
            db.watch(sql, throttle: const Duration(milliseconds: 250)),
      ),
    ),
  ],
  child: ...,
)

PowerSync#

Add one line to tell the panel the database is PowerSync's:

DatabaseAdapter(
  query: (sql, args) => db.getAll(sql, args),
  updates: db.updates.map((u) => u.tables),
  sync: DatabaseSync.powersync,
)

The panel then reads PowerSync's own tables through the same read-only query, and adds:

The panel doesn't detect PowerSync by itself. Without sync:, an app on plain SQLite gets none of this, and flutterware depends on no sync library either way.

Writes are opt-in#

Provide execute and an Execute SQL action appears, marked as dangerous everywhere it is shown. Leave it out and nothing can write to the database through the panel, from the studio, the command line or an agent:

DatabaseAdapter(
  query: (sql, args) => db.getAll(sql, args),
  updates: db.updates.map((u) => u.tables),
  execute: (sql, args) => db.execute(sql, args),  // this line turns writes on
)

What the panel offers#

From the command line, each is one call. An agent makes the same calls over MCP.

fw run run panelInvoke --panel=db:main --action=query \
  --args='{"sql": "SELECT * FROM orders WHERE status = ?", "args": "[\"open\"]"}'

Edit this page on GitHub