You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if this package could handle queries like:
SELECT COALESCE(SUM(likes), 0) FROM posts WHERE likes > 500;
A recent change to Fluent allows a default value when a SUM() query would result in null: vapor/fluent#573. However, the change requires every SUM() query to be preceded by a separate COUNT() query. A more efficient and reliable solution would be to use COALESCE().
In the example of Fluent's sum() function, you could still pass a nil value for the default, and then the COALESCE() function would result in null if the SUM() is also null.
The text was updated successfully, but these errors were encountered:
It would be great if this package could handle queries like:
A recent change to Fluent allows a default value when a
SUM()
query would result in null: vapor/fluent#573. However, the change requires everySUM()
query to be preceded by a separateCOUNT()
query. A more efficient and reliable solution would be to useCOALESCE()
.In the example of Fluent's
sum()
function, you could still pass anil
value for thedefault
, and then theCOALESCE()
function would result in null if theSUM()
is also null.The text was updated successfully, but these errors were encountered: