praeclarum/sqlite-net — pull request #286 by ericsink (2014-05-30 17:23:51+00:00)
Title: Changes to optionally build with SQLitePCL.raw as the lower layer.  

Define USE_SQLITEPCL_RAW (and probably USE_NEW_REFLECTION_API) to enable.

Full explanation of the changes in this commit:

1. #if USE_SQLITEPCL_RAW is very much like USE_WP8_NATIVE_SQLITE.
Exceptions noted below.

2. I introduced #if USE_NEW_REFLECTION_API as a subset of what
used to be #if NETFX_CORE. Compiling for any PCL profile with net45
will want USE_NEW_REFLECTION_API but will not want the other stuff
in NETFX_CORE.

3. I think BindText has an ambiguity about whether the n parameter
is in bytes or characters. It works fine when n<0. It also works
fine for ASCII text where count(bytes)==count(characters), such as
when the string is a GUID. Any other usage is probably broken.
In SQLitePCL.raw, sqlite3_bind_text and sqlite3_bind_blob lack the
n parameter, to avoid this problem, and for consistency, and because
the low-level purpose of improving efficiency doesn't work through the
C# boundary anyway.

4. USE_SQLITEPCL_RAW removes EnableLoadExtension (inherently not PCL-ish),
GetNullTerminatedUtf8 (not used), and 'using System.Runtime.InteropServices'
(not used).

5. USE_SQLITEPCL_RAW uses the NETFX_CORE version of the Volatile.Write
thingie.

6. These changes make sqlite-net compile under PCL profiles 78 or 259.
Support for net40-based profiles, like 158 (which may be what MvvmCross is
still using) would require some additional work. Specifically, don't set
USE_NEW_REFLECTION_API. And add a way to eliminate use of
System.Diagnostics.Stopwatch. And maybe more.