0

On my UWP app, I'm using sqlite-net to access the database. According to their GitHub Page I'm using Source Installation. Now I want to migrate to using the Nuget package (To get the latest updates) and they have mentioned getting the PCL package. When I add the PCL package I don't have Async operations available like it was on Source Installation. Please let me know how to proceed on this matter.

When it comes to UWP and I want to use sqlite-net I see soo many nugets in VS 2015 Nuget Package Manager. Please help me which one to choose. (Selected package should not be deprecated in the near future and should be developed actively by the vendor, providing continues updates)

enter image description here

SurenSaluka
  • 1,534
  • 3
  • 18
  • 36

2 Answers2

1

Based on your requirements of active development and support, have a look at EntityFramework Core with their SQLite Provider: https://learn.microsoft.com/en-us/ef/core/get-started/uwp/getting-started

This, however, limits the target version of platform to: Windows 10 Fall Creators Update (10.0; build 16299.0)

The package you have highlighted is a wrapper around the SQLite C library developed by the SQLite authors. There is no guarantee that the wrapper lib will always be under active development, but the SQLite C library should be.

MrCSharp
  • 1,143
  • 17
  • 28
  • Thanks for the insight. Unfortunately I have already developed a lot in the app so it’s not possible to change the ORM from SQLite to Microsoft. Al I need to know how to create Async SQLite connections using their Nuget. – SurenSaluka May 30 '19 at 03:14
  • 3
    @SurenSaluka It's seems there is no guarantee that a wrapper writer will always focus on updating the library for specific UWP platform. If you need active update, actually I think EF Core should be a better choice. – Barry Wang Jun 06 '19 at 07:34
1

You need to install both SQLite.Net.Async-PCL and SQLite.Net-PCL to use async operations.

SQLiteConnectionString connString = new SQLiteConnectionString(file.Path, true);
var asyncConnction = new SQLiteAsyncConnection(
    () => {
        return new SQLiteConnectionWithLock(new SQLitePlatformWinRT(), connString);
    }
);

Note that the SQLite.Net-PCL package is different from the one you installed. I'm not sure if the async package is compatible with that one.

Mehrzad Chehraz
  • 5,092
  • 2
  • 17
  • 28
  • This vendor seems to be done with this package after 2015. Are there any alternatives that I use for sqlite async who still active? What my company is expecting that we get continues updates and bug fixes so our product can improve over the years. - Thanks – SurenSaluka May 30 '19 at 09:02