Closed michaelstonis closed 1 year ago
Interesting. I didn't change anything JSON-related in the build options.
I just found this:
https://www.sqlite.org/json1.html
which says:
The JSON functions and operators are built into SQLite by default, as of SQLite version 3.38.0 (2022-02-22). They can be omitted by adding the -DSQLITE_OMIT_JSON compile-time option. Prior to version 3.38.0, the JSON functions were an extension that would only be included in builds if the -DSQLITE_ENABLE_JSON1 compile-time option was included. In other words, the JSON functions went from being opt-in with SQLite version 3.37.2 and earlier to opt-out with SQLite version 3.38.0 and later.
which seems relevant.
Awesome. Yea, all of my unit tests started failing because I had a check for ENABLE_JSON1
at launch. I am just going to add a call to select sqlite_version()
and evaluate the version. I wonder if there is a way to guarantee that it is available, but probably unnecessary for now.
Great find and thanks for the reply!
Just for reference, pragma_function_list
can provide the list of functions and can be used to make a determination from there.
Example
select exists(select 1 from pragma_function_list where name='json');
What version of SQLitePCLRaw are you using? 2.1.0+
If you are using one of the SQLitePCLRaw bundle packages, which one? SQLitePCLRaw.bundle_e_sqlite3
What platform are you running on? What operating system? Which version? What CPU? macOS. Ventura 13.1
What target framework are you building for? Not using framework
Are you on .NET Framework or the newer stuff (.NET Core, .NET 5+, etc)? .NET 6+
Are you using the command line, or an IDE? Which IDE? Which version of that IDE? Executing from unit test in visual studio mac
Is this problem something that just started happening? For example, were things working well for you and then you updated something and then the problem showed up? What changed? Issue started happening when updating from 2.0.7 to 2.1.0+
What is the exact error message you are seeing when the problem happens? Checking loaded compilation options,
ENABLE_JSON1
is no longer listedAre you using
PackageReference
orpackages.config
? PackageReferenceIf you are using mobile platforms, are you on classic/legacy Xamarin or on .NET 6 and higher? .NET 6+
Sometimes other packages using SQLitePCLRaw cause problems when they are mixed together. What other packages are you including in your project? Microsoft.Data.Sqlite
How can we reproduce the problem you are seeing? Your issue will get attention much faster if you attach a minimal reproduction sample project.
If I roll back to Microsoft.Data.Sqlite 5.0.13 and SQLitePCLRaw.bundle_e_sqlite3 2.0.7
Microsoft.Data.Sqlite 7.0.2 and SQLitePCLRaw.bundle_e_sqlite3 2.1.0-2.1.4