// These statics are here for lack of a better place to put them.
        // They exist here because they are called during the finalization of
        // a SqliteStatementHandle, SqliteConnectionHandle, and SqliteFunctionCookieHandle.
        // Therefore these functions have to be static, and have to be low-level.

        internal static string SQLiteLastError(SqliteConnectionHandle db)
        {
#if !SQLITE_STANDARD
            int len;
            return(UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg_interop(db, out len), len));
#else
            return(UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg(db), -1));
#endif
        }