question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aws-amplify datastore sqlite-adapter [Error: The predicate is not valid]

See original GitHub issue

Before opening, please confirm:

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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
iartemievcommented, Oct 27, 2021

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.

0reactions
github-actions[bot]commented, Oct 29, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DataStore - Syncing data to cloud - JavaScript - Amplify Docs
Learn more about how DataStore connects to an AppSync backend and automatically syncs all locally saved data using GraphQL. - JavaScript - AWS...
Read more >
@aws-amplify/datastore | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Why Amplify DataStore is not starting? - Stack Overflow
But I've tried to add start() and now I'm getting this error: DataStore - Schema is not initialized. DataStore will not function as...
Read more >
amplify-android / - aws-datastore / - src / - main / - java
java/aws-amplify/amplify-android/aws-datastore/src/main/java/com/amplifyframework/datastore/storage/sqlite/adapter/SQLPredicate.java.
Read more >
DataStore | amplify-js
This can be done by explicitiliy calling start() or any method that implicitly starts DataStore, such as query() , save() , or delete()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found