Skip to main content

CommandResult

KeyTypeDefaultDescription
commandstringName of the command (INSERT, SELECT, UPDATE, etc.)
fieldsFieldInfo[]Contains information about fields in column order
rowsRow[]Contains array of row data
rowType'array' | 'object' | 'custom'Row shape. 'custom' when a RowDecoder subclass was supplied via rowDecoder, since there's no way to know what shape it returns
executeTimenumberTime elapsed to execute the command
suspendedbooleantrue when an explicit fetchCount stopped the server before the statement ran to completion; rows is then a prefix, not the whole result. Only ever set when fetchCount was given; the default fetches every row. See fetchCount and suspended results.
rowsAffectednumberRows changed by INSERT/UPDATE/DELETE/MERGE (MERGE needs PostgreSQL 15+ and reports one total across all its actions). Left undefined for every other command, SELECT included, because the count those report is rows returned, not rows affected.