Last Updated: 3/10/2026
- QueryResult
Interface QueryResult
interface QueryResult<O> {
insertId?: bigint;
numAffectedRows?: bigint;
numChangedRows?: bigint;
rows: O[];
}
Type Parameters
- O
Index
Properties
insertId? numAffectedRows? numChangedRows? rows
Properties
Optional ReadonlyinsertId
insertId?: bigint
This is defined for insert queries on dialects that return the auto incrementing primary key from an insert.
Optional ReadonlynumAffectedRows
numAffectedRows?: bigint
This is defined for insert, update, delete and merge queries and contains the number of rows the query inserted/updated/deleted.
Optional ReadonlynumChangedRows
numChangedRows?: bigint
This is defined for update queries and contains the number of rows the query changed.
This is optional and only provided in dialects such as MySQL. You would probably use numAffectedRows in most cases.
Readonlyrows
rows: O[]
The rows returned by the query. This is always defined and is empty if the query returned no rows.
Settings
Member Visibility
On This Page
Properties