SQLitePCL.raw icon indicating copy to clipboard operation
SQLitePCL.raw copied to clipboard

Azure Mobile Apps SQLiteStore

Open myokeeh opened this issue 6 years ago • 8 comments

However, I'm not sure the Azure Mobile Apps libraries will get updated. I believe Microsoft has stopped new work on that product.

So you would want to stay with SQLitePCLRaw 1.x. However, you need ARM64.

Let me see if I can figure out a better solution for that case.

@ericsink have you looked into the Azure Mobile Apps problem? I don't want it to suddenly break. Maybe it won't, but I don't know enough about how these things work together to tell. Would forking that project to attempt to keep it up-to-date for myself something that you advise (or advise against)? I'm probably underestimating the work involved.

Originally posted by @myokeeh in https://github.com/ericsink/SQLitePCL.raw/issues/254#issuecomment-540827285

myokeeh avatar Oct 10 '19 22:10 myokeeh

To be clear, the main thing I had in mind when I wrote that comment was simply to find a way to make the ARM64 builds (of the native library) easier to use from SQLitePCLRaw 1.x.

The broader problem (of depending on Azure Mobile Apps even as Microsoft is no longer giving it much attention) isn't going away.

Yes, maintaining your own fork is probably a lot of work, but I lack the knowledge to say anything specific about that idea.

ericsink avatar Oct 17 '19 21:10 ericsink

The inevitable has happened. With the Microsoft.AppCenter 3.0.0 update, Azure Mobile Apps SQLiteStore now breaks.

myokeeh avatar Feb 21 '20 03:02 myokeeh

@myokeeh Exactly how does it break?

ericsink avatar Feb 21 '20 03:02 ericsink

Looking into it now. 3.0.0 now depends on SQLitePCLRaw.bundle_green 2.0.2--used to be sqlite-net-pcl

Prior to Microsoft.AppCenter 3.0.0, I've had the following in my csproj, and this allowed both Microsoft.Azure.Mobile.App.Client.SQLiteStore and Microsoft.AppCenter to work on x64 and ARM64:

    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3.v140">
      <Version>1.1.14</Version>
      <ExcludeAssets>All</ExcludeAssets>
      <IncludeAssets>none</IncludeAssets>
    </PackageReference>
    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3">
      <Version>2.0.2</Version>
    </PackageReference>

Now, simply upgrading to Microsoft.AppCenter 3.0.0 and running the app throws this:

Message = "Method not found: 'System.String SQLitePCL.raw.sqlite3_errstr(Int32)'."

   at Microsoft.WindowsAzure.MobileServices.SQLiteStore.SQLitePCLRawHelpers.VerifySQLiteResponse(Int32 result, Int32 expectedResult, sqlite3 db)
   at Microsoft.WindowsAzure.MobileServices.SQLiteStore.SQLitePCLRawHelpers.GetSqliteConnection(String filename)
   at Microsoft.WindowsAzure.MobileServices.SQLiteStore.MobileServiceSQLiteStore..ctor(String fileName)
   at IPAPP8WTS.App.<CreateStore>d__55.MoveNext() in C:\App.xaml_partial.cs:line 292

when establishing the MobileServiceSQLiteStore on this line:

store = new MobileServiceSQLiteStore(mobileServiceSQLiteStorePath);

Maybe it's not because of 2.0.2 after all? Is there a workaround I can try?

myokeeh avatar Feb 21 '20 03:02 myokeeh

It's probably related to the switch to 2.0.2.

First thing: make sure that nothing from SQLitePCLRaw 1.x is getting brought in. Check your package dependencies and transitive dependencies.

ericsink avatar Feb 21 '20 16:02 ericsink

The only ones I see that are dependent on anything SQLite are the following:

Microsoft.Azure.Mobile.Client.SQLiteStore depends on SQLitePCLRaw.bundle_green (>= 1.1.2) Microsoft.AppCenter depends on SQLitePCLRaw.bundle_green (>= 2.0.2)

I see the following in the Debug folder, but all seem to be version 2.0.2 SQLitePCLRaw.batteries_v2.dll SQLitePCLRaw.core.dll SQLitePCLRaw.provider.e_sqlite3.dll

myokeeh avatar Feb 22 '20 05:02 myokeeh

I’ve tried several Nuget packages that I thought might allow this to work, but can’t crack it.

myokeeh avatar Feb 26 '20 07:02 myokeeh

Hoping to get traction here: https://github.com/Azure/azure-mobile-apps-net-client/issues/533

myokeeh avatar Mar 13 '20 05:03 myokeeh

Closing old/stale issue.

ericsink avatar Sep 22 '22 21:09 ericsink