inbuilt-database

Creates and queries per-project PGlite databases with migrations and row-level security.

39|14|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/doable-me/Doable --skill inbuilt-database-doable-me
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: inbuilt-database
Source: https://github.com/doable-me/Doable/tree/main/services/api/src/ai/skills/_system/inbuilt-database
Command: npx skills add https://github.com/doable-me/Doable --skill inbuilt-database-doable-me

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Generated apps need a real persistence layer, but wiring up an external database like Supabase adds setup friction and credentials management. This Skill gives every Doable project a built-in, isolated PostgreSQL-compatible (PGlite) database so app data is stored and queried without any external service. ## Core Features & Use Cases - Schema migrations at build time: Create tables with data.migrate using idempotent, ordered migration IDs, then verify structure with data.schema before writing app code. - Mandatory row-level security: Every table gets a created_by column, RLS enabled, and an owner policy so each user only sees their own rows, with support for multi-tenant workspace policies. - Runtime queries from app code: Generated React/TypeScript apps import the pre-linked @doable/data package and run parameterized SELECT/INSERT/UPDATE/DELETE statements with typed { ok, rows, error } results. - Use Case: A user asks for a task tracker app. The Skill creates a tasks table via data.migrate with RLS, verifies it with data.schema, then generates app code that inserts and lists tasks through db.query — no Supabase, no localStorage. ## Quick Start Ask the AI to build an app that saves user data, and it will create the database schema with data.migrate and wire the app to the built-in database automatically.

Frequently Asked Questions about inbuilt-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I store data in a Doable app without Supabase?▼

Every Doable project includes a built-in PGlite PostgreSQL-compatible database, so no external database is needed. Create tables with the data.migrate tool at build time, then query them from app code by importing db from the pre-linked @doable/data package.

How do I create database tables for a generated app?▼

Use the data.migrate tool with a unique migration_id in NNNN_short_name format and CREATE TABLE IF NOT EXISTS statements. Migrations are idempotent, and you should verify the result with data.schema before writing any app code that queries the table.

Can I use localStorage instead of the built-in database?▼

No, localStorage, sessionStorage, and IndexedDB are forbidden for persisting real user records like tasks or notes. They are only acceptable for trivial ephemeral UI state such as dark mode preference; all real data must go through the inbuilt database.

Why is @doable/data missing from package.json?▼

The @doable/data package is deliberately pre-linked into every project's node_modules by the platform, so it resolves at runtime despite being absent from package.json. Never add it to dependencies or run install_package for it.

Why does my app query return no data after creating a table?▼

The runtime db.query path only accepts SELECT/INSERT/UPDATE/DELETE and rejects CREATE TABLE, so tables must be created via data.migrate first. Also check that RLS policies match the session identity, since rows are auto-scoped to the current user's created_by value.

Does the built-in database support multi-tenant apps?▼

Yes, add a workspace_id column to your tables and create a second RLS policy that joins through a workspace-membership table. Row-level security is mandatory by default, with per-user owner policies generated from the required table template.