This fixes a bug where v and nv filters don't work for SQL data sources 😬 The issue is that, because we handle those filters in the binary operation conditional block, we append the primitive value (which contains the expected type) to the SQL query https://github.com/observablehq/stdlib/blob/main/src/table.js#L420. You end up with a query with broken syntax in the WHERE clause:
We should just consider v and nv to be unary operations (I think it was originally my suggestion to handle them in the binary op block so that's my bad!!). I also added a unit test for this case.
This fixes a bug where
v
andnv
filters don't work for SQL data sources 😬 The issue is that, because we handle those filters in the binary operation conditional block, we append the primitive value (which contains the expected type) to the SQL query https://github.com/observablehq/stdlib/blob/main/src/table.js#L420. You end up with a query with broken syntax in theWHERE
clause:We should just consider
v
andnv
to be unary operations (I think it was originally my suggestion to handle them in the binary op block so that's my bad!!). I also added a unit test for this case.