Code Canvas Database
The Code Canvas Database is a managed per-project Postgres instance — accessible from generated apps via window.__db, with end-user auth, seeds, CSV import, schema history, and one-click revert.
In depth
Each Code Canvas project can enable a live Neon Postgres database. AI-generated app code can call window.__db.query for SQL and window.__auth.signup/login/logout for end-user authentication, all guarded by row-level security and a restricted public-query proxy.
Theo can create and seed tables, scope rows to the current end user, import CSV, and revert any DDL via the schema-history collection. Storage quotas are plan-based.
Examples
- Add a users table with auth
- Seed a contacts table from CSV
Also known as
Want to put this concept to work in OpenCharts?
Enable a databaseRelated terms
Code Canvas
Code Canvas is OpenCharts’ in-browser coding workspace — a Sandpack-powered live preview, multi-file editor, terminal, file tree, AI iterations, and a per-project Postgres database.
Try-to-Fix
Try-to-Fix is the one-click repair button in Code Canvas — when runtime errors appear, it sends the last 20 errors back to Theo to patch the code automatically.