我正在使用 Azure 移动服务,并且想要清除本地数据库,我该怎么做?
我的本地数据库有问题。当我在应用程序中注销并使用其他用户登录时,将为当前用户加载前一个用户的数据,我不知道为什么会发生这种情况。我在服务器端使用debug,服务器返回正确的数据,那么我认为问题出在本地数据库。
最佳答案
I'm using Azure Mobile Services and I want to clear local database, how can I do that?
要删除 SQLite 文件,您可以按照 Deleting the backing store 操作。此外,您还可以利用 IMobileServiceSyncTable
提供的功能来清除离线缓存下的记录,详细信息您可以按照 Purging Records from the Offline Cache 进行操作。 .
When I logout in app and login with other user, the data of the previous user is loaded for current user and I don't have idea why this occurs. I use debug on server side and the server return correct data
由于您没有提供有关实现的详细信息(例如用户登录/注销、用户数据管理等),我建议您检查您的服务器/客户端是否都启用了每用户数据存储。您可以使用 fiddler 捕获其他用户登录时的网络跟踪,并确保返回正确的用户标识符(例如 UserId),然后根据本地数据库检查查询。此外,我建议您关注阿德里安·霍尔(Adrian Hall)关于 Data Projection and Queries 的书。 .
关于azure - 如何使用 azure 移动服务清除本地数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50572187/