API Maker
The backend engine for the AI era
SchemasEpisode 3 7:01 13 chapters November 2026
In API Maker, the schema of a table is TypeScript written from the real table, kept in Git, and checked by the server on every write, whoever writes. Follow the rules of the support tickets of Calm Home: validations and conversions, nested objects and arrays, vectors and JSON, invented keys refused, and a schema compared with its table.
In the playlists The complete course Databases & schemas
A schema is the set of rules for a table. In API Maker, it is TypeScript, made from the real table, and kept in Git. The server checks it on every write, whoever writes. In this video, we look at the rules of the support tickets of Calm Home.
Without API Maker, data rules usually live in an entity class, a DTO, and a validator for each table. They are copied into every endpoint and script. And over time, they no longer match the real table. With API Maker, there is one schema for each table, made from the table. Its rules run on every API, and in your code. And the server compares it with the table. In this video: a generated schema, types, arrays, vectors, and JSON, checks and changes of values, keys the server refuses, a save that is refused, and a save that is cleaned, and the schema compared with the table.
Open Instance API. Pick MongoDB, then the catalog database, then products, and open its schema. It was made from the documents themselves. Each field has a type. A field is required when every document has it. Images and tags are arrays of text. Specs is an object inside the document, with its dimensions inside it. And variants is an array of objects. category_id even points to the categories. Its name was enough to know that.
Now PostgreSQL. Pick the instance postgres, then crm, then support_tickets. This schema was also made from the table. It has the primary key, numbered by the database, and the foreign key to customers. It has the length of each column, and NOT NULL becomes required.
Now we add a rule that sounds right: isUnique. An AI assistant might write this. Click Update. It is refused, by name, with the list of the valid keys. A schema never keeps a rule that does nothing.
Now the real rules. subject must have five characters or more, after spaces are trimmed. status must be one of three values. It is changed to capital letters first, and it is OPEN when it is missing. priority works the same way, with NORMAL by default. And created_at gets the date, when it is not given. Click Update.
Click Compare with the database. On the left is your schema. On the right is a schema made from the table as it is today. If someone added or changed a column, you see it here. Go back to the editor, and click Update and Close. The list of tables also tells you, before you open anything. When a table and its schema are different, its row has a mark.
The tooltip lists what is different. One click fixes it, field by field. The schema can follow the table, or the table can follow the schema. Video fifty four shows both ways.
Now let us save some data. Open API Testing, pick PostgreSQL, then crm, then support_tickets, and the API Save single-multiple. We type a bad ticket. The answer is four hundred, with one error for each field. The subject is too short after trimming, and the status and the priority are not in their lists. Nothing was saved in the table. Now a messy ticket: spaces around the subject, a priority in small letters, no status, and no date.
The answer is two hundred and one. The subject is trimmed. Priority is HIGH, status is OPEN, and created_at has the date. The schema did all of that.
Good to know. The same rules run when your custom APIs, hooks, and schedulers save data with g.sys.db calls. There are five types: string, number, boolean, date, and objectId. On MongoDB, you also get objects and arrays inside a document. validatorFun and conversionFun take your own function, for anything the keys do not cover. And the schema is a file in Git, so every change has its history.
A SQL column can also hold more than one value. A vector works on all five SQL databases. It is a list of numbers, so its schema says an array of numbers. A JSON column takes objects and lists. Bytes travel as a Buffer object, and shapes as GeoJSON. Generated APIs, schema APIs, and g.sys.db in all eight languages save, read, and update them the same way.
A new schema opens with a second tab. Data Analysis shows what the schema is made from. For each field, you see in how many documents it is, what types it has, and if its values repeat.
A saved schema has its Schema history. You see the version that is live in the database, and each commit of its file in Git. Open a commit to see what it changed. Here, it added the rules of the support tickets. Pick the first one, without the rules. It can be loaded into the editor, once you say yes. Nothing is saved until you click Update. Revert would write a version into the database right away.
Video forty one shows it.
The rules of a table are in one place, next to the table. Unknown keys and wrong types are refused, so a rule is never ignored, whoever wrote it. And there is one error format, field by field, on every database.
To sum up. A schema is made from the table. It has types, objects inside objects, arrays, vectors, and JSON. Its checks run on every write. Keys that do not exist are refused by name. And the schema is compared with the table. Next: data safety: encryption, hashing, IDs, and saves at the same time. API Maker. Build faster, spend smarter, deliver better.
Length 6:42Data safety
Length 4:56ER diagram
Length 10:05Six engines
Length 6:49Databases