System.Data.SQLite

Check-in [e945d6e2f9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the GetInvariantInt64 and GetInvariantDouble connection flags.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e945d6e2f9af196bceeb75ebaaa0633150685fa8
User & Date: mistachkin 2018-08-26 22:53:09.853
Context
2018-08-27
04:56
Reform how connection flags are checked. check-in: c947d6b1fb user: mistachkin tags: trunk
2018-08-26
22:53
Add the GetInvariantInt64 and GetInvariantDouble connection flags. check-in: e945d6e2f9 user: mistachkin tags: trunk
2018-08-16
05:47
For the primary NuGet package, use the framework-specific 'runtimes' meta-directory instead of relying on MSBuild targets to copy interop assemblies for the .NET Standard 2.0. Candidate fix for tickets [d292f2e23d] and [c438a5b5b9]. check-in: e1484cb4ad user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to System.Data.SQLite/SQLite3.cs.
4049
4050
4051
4052
4053
4054
4055

4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067

4068
4069
4070
4071
4072
4073
4074
4075
            return new Guid(b);

          return b;
        case TypeAffinity.DateTime:
          return GetDateTime(stmt, index);
        case TypeAffinity.Double:
          if (t == null) return GetDouble(stmt, index);

          return Convert.ChangeType(GetDouble(stmt, index), t, null);
        case TypeAffinity.Int64:
          if (t == null) return GetInt64(stmt, index);
          if (t == typeof(Boolean)) return GetBoolean(stmt, index);
          if (t == typeof(SByte)) return GetSByte(stmt, index);
          if (t == typeof(Byte)) return GetByte(stmt, index);
          if (t == typeof(Int16)) return GetInt16(stmt, index);
          if (t == typeof(UInt16)) return GetUInt16(stmt, index);
          if (t == typeof(Int32)) return GetInt32(stmt, index);
          if (t == typeof(UInt32)) return GetUInt32(stmt, index);
          if (t == typeof(Int64)) return GetInt64(stmt, index);
          if (t == typeof(UInt64)) return GetUInt64(stmt, index);

          return Convert.ChangeType(GetInt64(stmt, index), t, null);
        default:
          return GetText(stmt, index);
      }
    }

    internal override int GetCursorForTable(SQLiteStatement stmt, int db, int rootPage)
    {







>
|











>
|







4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
            return new Guid(b);

          return b;
        case TypeAffinity.DateTime:
          return GetDateTime(stmt, index);
        case TypeAffinity.Double:
          if (t == null) return GetDouble(stmt, index);
          bool invariantDouble = ((flags & SQLiteConnectionFlags.GetInvariantDouble) == SQLiteConnectionFlags.GetInvariantDouble);
          return Convert.ChangeType(GetDouble(stmt, index), t, invariantDouble ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture);
        case TypeAffinity.Int64:
          if (t == null) return GetInt64(stmt, index);
          if (t == typeof(Boolean)) return GetBoolean(stmt, index);
          if (t == typeof(SByte)) return GetSByte(stmt, index);
          if (t == typeof(Byte)) return GetByte(stmt, index);
          if (t == typeof(Int16)) return GetInt16(stmt, index);
          if (t == typeof(UInt16)) return GetUInt16(stmt, index);
          if (t == typeof(Int32)) return GetInt32(stmt, index);
          if (t == typeof(UInt32)) return GetUInt32(stmt, index);
          if (t == typeof(Int64)) return GetInt64(stmt, index);
          if (t == typeof(UInt64)) return GetUInt64(stmt, index);
          bool invariantInt64 = ((flags & SQLiteConnectionFlags.GetInvariantInt64) == SQLiteConnectionFlags.GetInvariantInt64);
          return Convert.ChangeType(GetInt64(stmt, index), t, invariantInt64 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture);
        default:
          return GetText(stmt, index);
      }
    }

    internal override int GetCursorForTable(SQLiteStatement stmt, int db, int rootPage)
    {
Changes to System.Data.SQLite/SQLiteBase.cs.
1306
1307
1308
1309
1310
1311
1312












1313
1314
1315
1316
1317
1318
1319
      /// Enable waiting for the enlistment to be reset prior to attempting
      /// to create a new enlistment.  This may be necessary due to the
      /// semantics used by distributed transactions, which complete
      /// asynchronously.
      /// </summary>
      WaitForEnlistmentReset = 0x100000000000,













      /// <summary>
      /// When binding parameter values or returning column values, always
      /// treat them as though they were plain text (i.e. no numeric,
      /// date/time, or other conversions should be attempted).
      /// </summary>
      BindAndGetAllAsText = BindAllAsText | GetAllAsText,








>
>
>
>
>
>
>
>
>
>
>
>







1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
      /// Enable waiting for the enlistment to be reset prior to attempting
      /// to create a new enlistment.  This may be necessary due to the
      /// semantics used by distributed transactions, which complete
      /// asynchronously.
      /// </summary>
      WaitForEnlistmentReset = 0x100000000000,

      /// <summary>
      /// When returning <see cref="Int64" /> column values, always use
      /// the invariant culture when converting their values from strings.
      /// </summary>
      GetInvariantInt64 = 0x200000000000,

      /// <summary>
      /// When returning <see cref="Double" /> column values, always use
      /// the invariant culture when converting their values from strings.
      /// </summary>
      GetInvariantDouble = 0x400000000000,

      /// <summary>
      /// When binding parameter values or returning column values, always
      /// treat them as though they were plain text (i.e. no numeric,
      /// date/time, or other conversions should be attempted).
      /// </summary>
      BindAndGetAllAsText = BindAllAsText | GetAllAsText,