Skip to content
Interactive demoDataAdvanced

Database-backed records

Create, edit, and delete rows that survive a restart — with an audit log written in the same transaction.

Built withPrisma 7Postgres (Neon)Server Actions

Before you try it

What it needs

Nothing to configure. It runs the same everywhere.

Mode right now

ReadyThe provider is configured here; nobody has watched the real path succeed on this deployment yet.

A safe failure to try

Create a project, then another with the same slug: the unique constraint comes back as a field error, and the first stays.

ProjectsLive data

0 rows in SQLite. These survive a restart — try creating one and reloading.

Sign in to create

No projects yet

The table is empty. Create one, or run `npm run db:seed` to load the sample set.

Audit log

Written in the same transaction as each change, so it cannot miss an event.

Nothing recorded yet.

What this demonstrates

  • A Server Component queries the database directly, with no API layer
  • Uniqueness belongs to a database constraint, not to a check-then-insert
  • Audit entries written in the same transaction, so they cannot be missed
  • revalidatePath invalidates the cached page after a mutation
  • One copy of the data: the server's. No client-side list to fall out of sync

Where the code lives

src/experiments/crud/demo.tsx

Registered in src/experiments/registry.ts and loaded on demand by loader.tsx.