amplify-swift
amplify-swift copied to clipboard
QueryField should support notContains operator
This documentation indicates that DataStore supports the notContains
operator, but it does not appear to be implemented in the library.
On amplify-js, It appears to be supported.
On Android, it is not supported, currently. A customer reported this missing functionality, here. Support is being added for Android in https://github.com/aws-amplify/amplify-android/pull/1145/
Hi @richardmcclellan, thanks for opening the issue
What does the SQL look like? I couldn't decipher exactly from the Android PR.
Is it "NOT LIKE"? select * from table_name where table_column_name NOT LIKE '%1%'
SO ref
What does the AppSync operator look like? this one looks simply as notContains
What does the SQL look like?
The SQL for contains
is: select * from table_name where instr(table_column_name,?) > 0
I believe LIKE
could be used instead of instr
? The performance of the two appears to be about the same. But, given that we were already using instr
for contains, I chose to add support for notContains
with a similar SQL command:
select * from table_name where instr(table_column_name,?) = 0
What does the AppSync operator look like? this one looks simply as
notContains
Correct, it is notContains
.
Working implementation for strings, but still early exploratory phase. https://github.com/aws-amplify/amplify-swift/pull/2789