← All glossary terms
Glossary

Code Canvas Database

GlossaryBy OpenCharts TeamPublished

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

window.__dbcode project DB

Want to put this concept to work in OpenCharts?

Enable a database

Related terms