aws-amplify datastore sqlite-adapter [Error: The predicate is not valid]
See original GitHub issueBefore opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
React Native
Amplify APIs
DataStore
Amplify Categories
api
Environment information
# Put output below this line
"dependencies": {
"@aws-amplify/datastore-storage-adapter": "^1.1.9",
"@azure/core-asynciterator-polyfill": "^1.0.0",
"@react-native-async-storage/async-storage": "^1.15.9",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^6.0.2",
"amazon-cognito-identity-js": "^5.2.0",
"aws-amplify": "^4.3.2",
"aws-amplify-react-native": "^5.0.4",
...
},
Describe the bug
In the official aws-amplify docs https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/#option-1-platform-integration it is said we can use SQLiteAdapter to improve performance over AsyncStorage. We encountered [Error: The predicate is not valid] when we do that.
Expected behavior
We want to integrate SQLiteAdapter without the error mentioned above i.e continue to use Datastore normally (CRUD operations)
Reproduction steps
npm install aws-amplify @aws-amplify/datastore-storage-adapter react-native-sqlite-storage aws-amplify-react-native amazon-cognito-identity-js @react-native-community/netinfo @react-native-async-storage/async-storage npx pod-install
import { DataStore } from ‘aws-amplify’; import { SQLiteAdapter } from ‘@aws-amplify/datastore-storage-adapter’;
DataStore.configure({ storageAdapter: SQLiteAdapter });
Code Snippet
// Put your code below this line.
type Enterprise @model @auth( rules: [ { allow: owner ownerField: “belongTo” } ] ) { id: ID! name: String! image: String contact: String email: String isDeleted: Boolean belongTo: String! } … await DataStore.query( Enterprise, (enterprise) => enterprise.isDeleted(“eq”, false), { sort: (s) => s.name(SortDirection.DESCENDING), } )
Log output
// Put your logs below this line
[Error: The predicate is not valid]
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
iPhone 6, iPhone Xr, LG G6, Xiaomi Redmi
Mobile Operating System
iOS 14.5, iOS 12.5, Android 9,10
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Hey @cybexai, thank you for reporting the issue. PR with the fix is up, I’ll update this issue once it’s merged and deployed.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.