API Maker
The backend engine for the AI era
Deep populateEpisode 10 9:25 9 chapters November 2026
Deep populate swaps the ids in your rows for the rows they point to: one call, any depth, in one database or across six engines. An order comes back with its customer and city from PostgreSQL, its coupon from MariaDB, its employee from Oracle, its lines from MySQL with their products from MongoDB, and its shipments from SQL Server.
In the playlists The complete course Generated APIs
Your rows often hold IDs that point to other rows. Deep populate puts the real rows in place of those IDs. One call, any depth, in one database or across six databases.
An order is mostly IDs: a customer, a coupon, an employee, and its lines. To show the full order, teams write a join for every database driver. Many end up with one query for each row. This is called the N plus one problem. When the customer is in another database, no join can reach it. So a glue service merges the results by hand. And each step is one more permission check you can forget.
With API Maker, you just name the column in deep. It reads each linked table only once, for all the rows, through that table's own API. We start in one database. Then we make one call across six databases. Then we shape every level, see how it runs, call it from code, and end with a few good habits.
Open API Testing. Pick the instance mysql, then the database sales, then the table order_items, and the API Get all. In Query Params, we find the lines of order three. In deep, we type order_id. Send. Now each line has its whole order, in place of the number three. We typed only a column name. So how does it know where order_id points? Open Instance API, the table order_items, and its schema.
Here it says: table orders, column id. API Maker wrote these lines itself, from the MySQL foreign key, when it made the schema. A relation is written once, in one place, and every call uses it. Now the other way: one order with all its lines. Pick orders, then Query for get data. The body has two keys. Find picks order three. Deep names the field items, and isMultiple true makes it a list, with every line of the order.
Send. Order three comes back with its four lines, read in one query. Items is a virtual field. It is one schema line that points back from order_items. The next video is about virtual fields.
Calm Home keeps its data in six databases, and the schema of orders links them. The customer is in PostgreSQL. It uses the same lines, plus an instance and a database. The coupon is in MariaDB. The employee who handled the order is in Oracle. And its lines and its shipments are virtual fields, one in MySQL, and one in SQL Server. Now, one call for all of it. On orders, in Query for get data, the body asks for order three, with five deep items: the customer and its city, the coupon, the employee, the lines with their products, and the shipments.
Each item selects only the columns it needs. Send. One answer, from six databases. The order comes from MySQL. The customer and its city come from PostgreSQL. The coupon comes from MariaDB. The employee comes from Oracle, with names in capital letters. The lines come from MySQL, their products from MongoDB, and the shipment from SQL Server. Your code gets one JSON document. No second driver, no glue service, and no merge loop.
Each deep item takes the same keys as a query, just like the top level. Here, find, sort, and limit ask for the four biggest delivered orders. On the customer, find keeps only gold customers. On the lines, we sort by price, biggest first, and limit to one. That gives the most expensive line of each order. Send. The gold customer is filled in. The others keep their ID. And each order shows one line.
Skip works the same way, and the primary key of each row always stays. A level inside a level can be written in two ways. You can put a deep inside the item, or list the paths: customer_id, then customer_id dot city_id, which is the city of that customer. In a query string, you use the same names, with commas between them. All three give the same answer. Pick one style for your team, so your code looks the same everywhere.
What if the schema has no link? Then you name the target in the item. Here is the support team, in Oracle. For each employee, we want the orders they handled, in MySQL. In a deep item, S means source, and T means target. s_key, the source key, is the ID of the employee. t_instance, t_db, and t_col name the target table, orders. t_key is its column that holds that ID.
isMultiple asks for a list, sorted by total, two for each. Send. The ID is replaced by the list. To keep the ID and add a field next to it, use a virtual field, as in the next video. A typing mistake does not fail silently. We ask for customer, instead of customer_id, and the answer is a four hundred. Errors names the missing property, and data still holds the rows.
It is the same error format as every API of API Maker. So a client handles it once.
How does it run? One query reads the orders. Then, for each deep item, API Maker collects the IDs of every row, and asks the target table once, with an IN list. So customers, coupons, employees, lines, and shipments each take one query. Then the next level, cities and products, take one query each again. That is eight queries, if you ask for twenty orders or for five hundred. If you read them row by row, the same twenty orders take one hundred and seventy three queries: one for each customer, city, coupon, and employee, one for each order's lines and shipments, and one for each line's product.
With deep, it takes eight. Fewer round trips, and no loop in your code to get wrong. Each of these queries goes through the query API of its table, inside the server. So the rules of that table apply. The IDs are changed to the types of the target schema. Your token is checked on every table it reaches, and the columns your group may not read are removed. A table with caching on answers from its cache.
And the hooks of the target do not run for these reads.
From your own code, it is the same call. In Custom API, pick Order Overview, on API Testing. Its code calls g.sys.db.getAll on orders, with deep in its query parameters. It asks for the twenty biggest delivered orders, with the same five items. No driver, no connection string, and no join to write. Send. Twenty orders come back, filled from six databases. Open Index Maker, then DB Calls. There is one row for each table, and each one is called once.
Eight queries for twenty orders. The same deep works in all eight languages, with types. In Python, it is a DeepItem. In Go, an am.DeepItem with SKey. C sharp, Java, Kotlin, PHP, and Rust have the same class. In TypeScript, the editor knows every key of an item. It is one shape everywhere. So code written by an AI assistant follows the same standard, and the server checks every s_key against the schema.
Here are a few good habits. Write relations in the schema, so callers only name the column. Select only the columns you need, at every level. Give every list a sort and a limit. For one to many, use a virtual field, so the ID stays. And to filter rows by a linked table, use find and join, which works with deep.
Deep populate, in short. Name a column, and get its row. Any depth, across six databases, in one call. Find, select, sort, and limit on every level. One query for each item, through each table's own API. And the same call from code, in eight languages. Next, virtual fields: the one to many side of a relation. API Maker. Build faster, spend smarter, deliver better.
Length 5:24Virtual fields
Length 5:09Find and join
Length 4:55Request headers
Length 8:20Web and mobile