ToolsCommandsCommands for looking into and changing code
jadpo sql
On this page
Show the SQL a query or action sends.
Print the PostgreSQL a query compiles to (area 6): its statement, then one more for each include, however many records it is included in, each with the parameters that fill it and where their values come from. Given an action, print the statement each of its writes sends, with what each refusal raises: the failure a conflict: arm names, the not-found failure or a fault. The statements are fixed when the project is compiled, so the same query always sends the same text. The project must check without errors first. --explain, which runs the query on a disposable database and shows PostgreSQL's plan, comes later.
jadpo sql [name]Arguments
name(optional): The query's or action's name
Flags
--explain: Show PostgreSQL's plan (not built yet)
On every command
--json: Print data for tools instead of text--full: Show everything a report shortens--help: Show every flag, with examples--color <when>: Choose when to use colour
jadpo sql --json writes one JSON document to standard output instead of text, with the same exit code. The document has schemaVersion, command ("sql"), ok, data (what the command produced, null when it failed) and diagnostics (each error with its rule, reason, next and help). A command that needs a terminal refuses --json and names the flags that do the same job.
Examples
# Show the statements a page query sendsjadpo sql latest_entries# Show the statements an action's writes sendjadpo sql archive_entry
Errors
cli.sql_arguments: Ajadpo sqlcommand names no query or action, one the project doesn't declare, or an action that writes nothingtoolchain.not_built_yet: Operation is declared but not built yettoolchain.project_not_found: You ran a command that works on a project in a folder with noapp.jadpo, in it or in any folder above it
Markdown for agents: /docs/jadpo-sql.md.Built from Jadpo main at aee2e8f.