Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPK SQLite Support #11017

Open
dpilch opened this issue Feb 22, 2023 · 2 comments
Open

CPK SQLite Support #11017

dpilch opened this issue Feb 22, 2023 · 2 comments
Labels
DataStore Related to DataStore category feature-request Request a new feature

Comments

@dpilch
Copy link
Member

dpilch commented Feb 22, 2023

Is this related to a new or existing framework?

React Native

Is this related to a new or existing API?

DataStore

Describe the feature you'd like to request

Add CPK support to SQLite adapter. New projects are created with respectPrimaryKeyAttributesOnConnectionField set to true by default. This results in new projects using SQLite to face issues.

Workaround

If you are facing issues with SQLite please set graphQLTransformer.respectPrimaryKeyAttributesOnConnectionField to false as a workaround.

@mhyassin
Copy link

Hey 👋 Will we be seeing this soon?

@jsancho
Copy link

jsancho commented Nov 16, 2023

Same here, would be great to know whether this feature is being planned or or whether it's been discarded.

In my case I'm using Amplify with 2 types of clients: a react web app and a react-native app.

I've been using CPKs with models following DynamoDB best practices.
After noticing a huge performance degradation in react-native when querying a table with 5000+ records, I configured the SQlite storage adapter, which fixed the performance issues and the app is usable again.

Trouble is that this has required to set the respectPrimaryKeyAttributesOnConnectionField to false and now I'm having data sync issues and warnings related to id fields and their relationships.

This is quite a setback, as it's going to involve redefining data model keys, relationships, destroying tables and pretty much recreating the environment. Not an ideal DX in my view.

I might be wrong on this part and it might not be necessary to redefine all models
My understanding is that when using respectPrimaryKeyAttributesOnConnectionField the syntax for the @primaryKey directive will be ignored and I should refactor my keys to use id : ID across the board?

Could you also shed some light on what are the current plans for supporting CPKs when using the SQLite adaptor?

thanks

@chrisbonifacio chrisbonifacio removed the p3 label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DataStore Related to DataStore category feature-request Request a new feature
Projects
None yet
Development

No branches or pull requests

5 participants