Your Postgres schema, typed in your repo.
With the Xano SDK, tables and indexes are typed TypeScript you version, review and diff. A table reference is a real foreign key, type-checked. The Xano Engine is a single binary with Postgres built in, so the same database runs on your laptop.
The Xano databaseimport { table, f } from "@xano/sdk";
const user = table({
name: "user",
auth: true,
schema: {
email: f.email({ required: true, methods: ["trim", "lower"] }),
name: f.text(),
},
});
export const post = table({
name: "post",
schema: {
title: f.text({ required: true }),
published: f.bool({ default: false }),
author: f.tableRef(user), // a real foreign key, type-checked
},
});