Skip to main content
Kiran Brahma
All writing

O9X Build Log 7: Schema Sovereignty in a Sandbox

Published Part 7 of O9X Build Logs

Every book, article, and video I came across said the same thing: if I get my database schema wrong, I am toast. I knew from day one that PostgreSQL had to be the final destination for O9X. It is the right choice to handle multiple users, permissions, and concurrent access reliably.

Jumping straight into PostgreSQL as a non-coder felt like a trap. I would have spent hours wrestling with SQL sessions, migrations, and access rules instead of testing my business logic with AI. I needed a local sandbox I could break and rebuild quickly before writing any real code.

I looked at two options. Baserow is capable and cloud-first, and it works well when tied to an external SQL backend, but getting a clean, portable schema out of it felt like extra work. PocketBase is a single executable under 30 MB that runs locally without setup or an internet connection. I picked PocketBase right away because I could test my logic on my own machine without dealing with latency or permissions.

PocketBase lets me design tables visually without writing code. I could link Guards to Sites and Attendance to Shifts, and if I broke the schema, I rebuilt it in minutes. The real benefit was that PocketBase exports the entire schema as a clean JSON file. That file gave me an explicit, portable record of my data structure.

I set a strict rule that AI would not invent my database structure. By designing the tables myself inside PocketBase, I locked down how data moves through the app. PocketBase became my testing lab, PostgreSQL stayed my target for production, and the JSON schema file served as the bridge between them.

Instead of planning tables in spreadsheets, I built my core tables like Staff, Units, and Logs directly in PocketBase. I exported the schema as JSON and uploaded it into a fresh AI session as the reference for all code generation. The AI only touches the specific tables and changes I allow. That keeps the model from inventing columns, drifting from my rules, or generating blueprints I cannot understand.