Swift-Kuery icon indicating copy to clipboard operation
Swift-Kuery copied to clipboard

Support Postgres DISTINCT FROM

Open bridger opened this issue 8 years ago • 1 comments

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 = NULL yields null, as does 7 <> NULL. When this behavior is not suitable, use the IS [ 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")

bridger avatar Jul 24 '17 00:07 bridger

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.

kilnerm avatar Sep 04 '18 12:09 kilnerm