Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cpakken opened this issue Jun 19, 2024 · 0 comments
Open

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

cpakken opened this issue Jun 19, 2024 · 0 comments

Comments

@cpakken
Copy link

cpakken commented Jun 19, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant