import { CompiledQuery } from '../query-compiler/compiled-query.js'; /** * A single connection to the database engine. * * These are created by an instance of {@link Driver}. */ export interface DatabaseConnection { executeQuery(compiledQuery: CompiledQuery): Promise>; streamQuery(compiledQuery: CompiledQuery, chunkSize?: number): AsyncIterableIterator>; } export interface QueryResult { /** * @deprecated use {@link QueryResult.numAffectedRows} instead. */ readonly numUpdatedOrDeletedRows?: bigint; /** * This is defined for insert, update, delete and merge queries and contains * the number of rows the query inserted/updated/deleted. */ readonly numAffectedRows?: bigint; /** * This is defined for update queries and contains the number of rows * the query changed. * This is optional and only provided by some drivers like node-mysql2. */ readonly numChangedRows?: bigint; /** * This is defined for insert queries on dialects that return * the auto incrementing primary key from an insert. */ readonly insertId?: bigint; /** * The rows returned by the query. This is always defined and is * empty if the query returned no rows. */ readonly rows: O[]; }