Question

I'm starting to rebuild my app to MvvmCross, but I hit a small roadblock. It seems the community plugin for SQLite doesn't support async connection and querying. WinRT requires data access and other long-running operations to be performed asynchrnously, so this seems like an issue (although I think it is safe to say, that normal operations won't take that long to make this matter). I just wanted to ask, if asynchronous support is somehow possible to add and if this feature will be somehow added in future releases.

Thank you all very much!

Was it helpful?

Solution

Don't use the mvvmcross sqlite plugin. Instead use the PCL compatible "sqlite.net pcl". It has both sync and async versions.

github: https://github.com/oysteinkrog/SQLite.Net-PCL

nuget: http://www.nuget.org/packages/SQLite.Net-PCL/

OTHER TIPS

The cg+sql branch of my fork contains provisions to use Async in mvvmcross-sqlite

https://github.com/loqu8/mvvmcross-sqlite/tree/cg+sql

Take a look and see if it works for you. It is based on sqlite-net Async.

Please look at TODOs in MvvmCross Sqlite-Net (https://github.com/MvvmCross/MvvmCross-SQLite) readme file. The first one:

add Async - @Praeclarum and @Jarroda have already done the 'hard work' - we just need to work out how to include it - do we switch to Profile78? Do we drop WP7.5? Do we hack in AsyncBridge somehow?

So it seems that we will get Async support some day and will get even more fun from using MvvmCross! :-)
For now it seems that the only solution is to create low-level data access interface with save/load/find methods and implement it in platform-specific projects.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top