Skip to content

[Bug]: Query failed if there is only false field in the select params #2344

@jiashengguo

Description

@jiashengguo

The below code will show error:

    await db.user.findMany({
      select: {
        id: false,
      },
    }),
    reason: 'db-query-error',
    model: undefined,
    dbErrorCode: 'SQLITE_ERROR',
    dbErrorMessage: 'near "from": syntax error',
    rejectedByPolicyReason: undefined,
    sql: 'select from "User" ',

It generate a select statement without any field to be selected which cause the SQL error.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions