Swift-Kuery
Swift-Kuery copied to clipboard
Support Postgres DISTINCT FROM
From the Postgres docs there are two ways to handle equality of columns, depending on how you'd like to handle null:
Ordinary comparison operators yield null (signifying "unknown"), not true or false, when either input is null. For example,
7 = NULLyields null, as does7 <> NULL. When this behavior is not suitable, use theIS [ NOT ] DISTINCT FROM constructs:
I need to use IS DISTINCT FROM, but it seems it isn't supported by Swift Kuery.
Another feature request would be to handle arbitrary string filters. That way when something isn't implemented in Swift Kuery yet I could do something like:
SELECT(documents.documentId, from: documents).where(documents.saved.isNotNull() && "documents.saved IS DISTINCT FROM documents.uploadedToS3")
This warrants some further investigation as our supported plugins all provide null safe operators. I'll mark as an enhancement and leave for future consideration.