Skip to main content

Module dry_run

Module dry_run 

Source
Expand description

LIMIT 0 dry-run helper.

Wraps arbitrary user SQL in a CTE and runs it against the shared CompileTimeDb, returning the ResultSchema without touching any rows.

§Critical: query execution is lazy (Phase 0 S6)

Connection::execute_query() does NOT run the query on the TCP transport. The query only executes — and server errors / the RowDescription (schema) only arrive — when Rowset::next_chunk() first pulls bytes. Therefore:

  • execute_query(sql).is_err() alone always looks Ok.
  • This helper calls next_chunk() once to force execution, then reads Rowset::schema().

Functions§

dry_run
Wrap user_sql in a LIMIT 0 CTE and return the projected ResultSchema.