Skip to content

Inserting with query builder attempts to insert a default row when values is empty array #3111

@lazarljubenovic

Description

@lazarljubenovic

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql / mariadb
[ ] oracle
[x] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

        await this.tableRepo
          .createQueryBuilder()
          .insert()
          .into(Table)
          .values([])
          .execute()
INSERT INTO "table"("row1", "row2", "row3") VALUES (DEFAULT, DEFAULT, DEFAULT)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions