dflourusso / expo-sqlite-orm

Expo SQLite ORM
132 stars 34 forks source link

Proposal for Missing Operators `OR`, `BETWEEN`, `IS NULL`, `IS NOT NULL`, extending `LIKE` #67

Open eznix86 opened 5 months ago

eznix86 commented 5 months ago

OR operator

OR operator is discussed here -> #66

LIKE operator

{"startsWith": "John"}

creates LIKE 'John%'

{"endsWith": "John"}

creates LIKE '%John'

{"contains": "John"}

creates LIKE '%John%'

[!NOTE] The current implementation of contains allows %John% to be passed it can be prone to SQL injection

LIKE with CASE INSENSITIVE operator

{"istartsWith": "John"}
{"iendsWith": "John"}
{"icontains": "John"}

Similar as above, but appends collate NOCASE.

BETWEEN operator

{"between": [1, 25]}

IS NULL operator

{"null": true}

IS NOT NULL operator

{"notnull": true}