Tanstack DB currently doesn't support boolean columns as filters. We often end up having to write filters like this:
const { data: products } = useLiveQuery(q =>
q.from({ product: productCollection })
.where(({ product }) => product.in_stock) // Use computed field
.where(({ product }) => eq(product.in_stock, true))
)
This isn't idiomatic since product.in_stock is already a boolean so we should be able to just write where(({ product }) => product.in_stock). And similarly we often end up writing negations as eq(product.in_stock, false) instead of the more idiomatic not(product.in_stock).
Tanstack DB currently doesn't support boolean columns as filters. We often end up having to write filters like this:
This isn't idiomatic since
product.in_stockis already a boolean so we should be able to just writewhere(({ product }) => product.in_stock). And similarly we often end up writing negations aseq(product.in_stock, false)instead of the more idiomaticnot(product.in_stock).