feat(datastore): Add DataBase Name Provider as optional parameter on DataStore plugin initializer#2808
Open
baldarama wants to merge 4 commits intoaws-amplify:mainfrom
Open
Conversation
added 2 commits
March 11, 2023 11:59
…ding-DataStore-database-custom-naming # Conflicts solved: # AmplifyPlugins/DataStore/Sources/AWSDataStorePlugin/AWSDataStorePlugin.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #
Description
this changes will allow developers to specify a name for the DataStore database file, this is needed in apps that allow multiple users one at at time.
app is configured with a sync expression that syncs all records of a user based in his "accountId"
each user has a unique "accountId"
the app can be used by multiple users one at a time
scenario
there are 2 users User a and User b
in the above scenario user b records will not be synced, only the changes that happened between the time user a logged out and user b logged in will be synced, user b may be able to see user a records.
solution 1 (this is not a good solution but it is what can be done before changes on this pr)
clear data store before sync when it is detected that a different user has logged in
solution 2 (only possible with the changes in this pr)
specify datastore database name in a way that each user has its own database file.
General Checklist
Given When Theninline code documentation and are named accordinglytestThing_condition_expectation()By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.