engine_db_select
Run parameterized SQL selects to retrieve database records, manage large results with file snapshots, and check table dependencies.
Instructions
Read data. pool is a list of steps, each {"do":"select","sql":"..."} with optional params and name. A value belongs in params and not in the text of the sql: write :NAME in the sql, upper case, and put the value in params under that name in any case you like. That is what keeps a quote, an apostrophe or an alphabet of its own from breaking the query. Table names take {DBNICK}_ or the real nick, both work. Values come back whole - no truncation, no column limit - so ask for the rows you need, not for a million. A step over 5000 rows is refused unless it carries "big":true. A step that carries "file" keeps its rows there instead of in the answer - one json object to a line, at any size, path absolute or off the store folder: that is how a snapshot of what you are about to change is taken, and it belongs in your own folder, not under mcp/melbis, which is wiped without warning. The pool of this command also takes the dependent step (table, and ids when you have them): what hangs on that table, and how many rows point at those ids. It only reads, so it belongs here as much as a select. A pool too big to write out is built by a script and given as pool_file instead of pool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pool | No | ||
| pool_file | No | Path on this machine, absolute or off the store folder, to a json file holding the pool - the same list of steps; instead of pool. |