3

While debugging a query that unexpectedly returned an empty list, I realized that I wrote something silly:

fetchDim cId = runDb . select . from $ \dim -> do
  where_ dim ^. DimensionIsRowKey ==. val True
  return dim

... because you can append == True to any Boolean value. Replacing it with the following unexpectedly solved my problem and the result wasn't an empty list anymore.

fetchDim cId = runDb . select . from $ \dim -> do
  where_ dim ^. DimensionIsRowKey
  return dim

Anyone can enlighten me about the actual difference between the two? Why would there be any?

EDIT: The database backend is sqlite.

ruben.moor
  • 1,876
  • 15
  • 27

0 Answers0