Skip to content

where filter does not work on BOOLEAN property that is indexed #41

@cpakken

Description

@cpakken

Bug only on indexed boolean property. Works find is 'done' prop is converted to number using 0 or 1

 const db = createDB()
  type Todo = { id: number; text: string; done: boolean }
  const todos = createTable<Todo>(db, 'todos')({ primary: 'id', indexes: ['done'] })

  await insert(todos, { id: 1, text: 'Buy milk', done: false })
  await insert(todos, { id: 2, text: 'Buy bread', done: true })

  const all = await many(todos, { where: { done: false } })
  //All is empty if indexes is 'done'
  //Works if does not have indexes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions