Skip to content

[BUG]: sqlite-proxy require rows: any[] but runtime expects undefined for get method no-row result #5461

@egoist

Description

@egoist

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

0.45.1

What version of drizzle-kit are you using?

0.31.9

Other packages

No response

Describe the Bug

import { drizzle } from "drizzle-orm/sqlite-proxy"

drizzle((query, values, method) => {
  if (method === 'get') {
    return { rows: [] /* should use falsy value here to indicate no rows instead */ }
  }
}, schema)

if returns [] as rows a db query like db.query.table.findFirst({ columns: {id: true} }) will return {id: undefined} even if the row does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions