diff --git a/src/query-builder/insert-query-builder.ts b/src/query-builder/insert-query-builder.ts index 2190d0b96..bbfac24a5 100644 --- a/src/query-builder/insert-query-builder.ts +++ b/src/query-builder/insert-query-builder.ts @@ -111,13 +111,18 @@ export class InsertQueryBuilder * }) * .executeTakeFirst() * + * // The `insertId` is only available on dialects that automatically + * // return the id of the inserted row such as MySQL and SQLite. + * // On postgres, for example, you need to add a `returning` clause + * // to the query to get anything out. See the "returning data" + * // example. * console.log(result.insertId) * ``` * - * The generated SQL (PostgreSQL): + * The generated SQL (MySQL): * * ```sql - * insert into "person" ("first_name", "last_name", "age") values ($1, $2, $3) + * insert into `person` (`first_name`, `last_name`, `age`) values (?, ?, ?) * ``` * *