System.Data.SQLite

Check-in [bfd912fefd]
Login

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

Overview
Comment:Add GetFieldAffinity method to the SQLiteDataReader class.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bfd912fefde8b9b409063aa5bdfec2d986b030fe
User & Date: mistachkin 2018-04-12 18:34:44.115
Context
2018-04-12
22:21
Correct result checking semantics and expected results for test 'types-2.13' to account for a String.Equals() issue in the .NET Framework. check-in: 37355d65e9 user: mistachkin tags: trunk
18:34
Add GetFieldAffinity method to the SQLiteDataReader class. check-in: bfd912fefd user: mistachkin tags: trunk
2018-04-09
17:25
Revise batch build tool for Mono to include support for Visual Studio 2017 as well. check-in: 8903d7bf8e user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Doc/Extra/Provider/version.html.
43
44
45
46
47
48
49

50
51
52
53
54
55
56
    <div id="mainSection">
    <div id="mainBody">
    <h1 class="heading">Version History</h1>
    <p><b>1.0.109.0 - May XX, 2018 <font color="red">(release scheduled)</font></b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_23_0.html">SQLite 3.23.0</a>.</li>
      <li>Prevent GetSchemaTable from throwing InvalidCastException. Fix for <a href="https://system.data.sqlite.org/index.html/info/baf42ee135">[baf42ee135]</a>.</li>

    </ul>
    <p><b>1.0.108.0 - March 2, 2018</b></p>
    <ul>
      <li>Support extended result codes when messages are looked up without the SQLite core library.</li>
      <li>Override System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/53962f9eff">[53962f9eff]</a>.</li>
      <li>More database connection configuration options for the <a href="https://www.sqlite.org/c3ref/db_config.html">sqlite3_db_config()</a> interface.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Set HResult property of SQLiteException based on the SQLite core library error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>







>







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
    <div id="mainSection">
    <div id="mainBody">
    <h1 class="heading">Version History</h1>
    <p><b>1.0.109.0 - May XX, 2018 <font color="red">(release scheduled)</font></b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_23_0.html">SQLite 3.23.0</a>.</li>
      <li>Prevent GetSchemaTable from throwing InvalidCastException. Fix for <a href="https://system.data.sqlite.org/index.html/info/baf42ee135">[baf42ee135]</a>.</li>
      <li>Add GetFieldAffinity method to the SQLiteDataReader class.</li>
    </ul>
    <p><b>1.0.108.0 - March 2, 2018</b></p>
    <ul>
      <li>Support extended result codes when messages are looked up without the SQLite core library.</li>
      <li>Override System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/53962f9eff">[53962f9eff]</a>.</li>
      <li>More database connection configuration options for the <a href="https://www.sqlite.org/c3ref/db_config.html">sqlite3_db_config()</a> interface.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Set HResult property of SQLiteException based on the SQLite core library error code.&nbsp;<b>** Potentially Incompatible Change **</b></li>
Changes to System.Data.SQLite/SQLiteDataReader.cs.
909
910
911
912
913
914
915





















916
917
918
919
920
921
922

        if (i >= PrivateVisibleFieldCount && _keyInfo != null)
            return _keyInfo.GetDouble(i - PrivateVisibleFieldCount);

        VerifyType(i, DbType.Double);
        return _activeStatement._sql.GetDouble(_activeStatement, i);
    }






















    /// <summary>
    /// Returns the .NET type of a given column
    /// </summary>
    /// <param name="i">The index of the column.</param>
    /// <returns>Type</returns>
    public override Type GetFieldType(int i)







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







909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943

        if (i >= PrivateVisibleFieldCount && _keyInfo != null)
            return _keyInfo.GetDouble(i - PrivateVisibleFieldCount);

        VerifyType(i, DbType.Double);
        return _activeStatement._sql.GetDouble(_activeStatement, i);
    }

    /// <summary>
    /// Determines and returns the <see cref="TypeAffinity" /> of the
    /// specified column.
    /// </summary>
    /// <param name="i">
    /// The index of the column.
    /// </param>
    /// <returns>
    /// The <see cref="TypeAffinity" /> associated with the specified
    /// column, if any.
    /// </returns>
    public TypeAffinity GetFieldAffinity(int i)
    {
        CheckDisposed();

        if (i >= PrivateVisibleFieldCount && _keyInfo != null)
            return _keyInfo.GetFieldAffinity(i - PrivateVisibleFieldCount);

        return GetSQLiteType(_flags, i).Affinity;
    }

    /// <summary>
    /// Returns the .NET type of a given column
    /// </summary>
    /// <param name="i">The index of the column.</param>
    /// <returns>Type</returns>
    public override Type GetFieldType(int i)
Changes to System.Data.SQLite/SQLiteKeyReader.cs.
518
519
520
521
522
523
524







525
526
527
528
529
530
531

    internal string GetDataTypeName(int i)
    {
      Sync();
      if (_keyInfo[i].query != null) return _keyInfo[i].query._reader.GetDataTypeName(_keyInfo[i].column);
      else return "integer";
    }








    internal Type GetFieldType(int i)
    {
      Sync();
      if (_keyInfo[i].query != null) return _keyInfo[i].query._reader.GetFieldType(_keyInfo[i].column);
      else return typeof(Int64);
    }







>
>
>
>
>
>
>







518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538

    internal string GetDataTypeName(int i)
    {
      Sync();
      if (_keyInfo[i].query != null) return _keyInfo[i].query._reader.GetDataTypeName(_keyInfo[i].column);
      else return "integer";
    }

    internal TypeAffinity GetFieldAffinity(int i)
    {
      Sync();
      if (_keyInfo[i].query != null) return _keyInfo[i].query._reader.GetFieldAffinity(_keyInfo[i].column);
      else return TypeAffinity.Uninitialized;
    }

    internal Type GetFieldType(int i)
    {
      Sync();
      if (_keyInfo[i].query != null) return _keyInfo[i].query._reader.GetFieldType(_keyInfo[i].column);
      else return typeof(Int64);
    }
Changes to readme.htm.
209
210
211
212
213
214
215

216
217
218
219
220
221
222

<p>
    <b>1.0.109.0 - May XX, 2018 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_23_0.html">SQLite 3.23.0</a>.</li>
    <li>Prevent GetSchemaTable from throwing InvalidCastException. Fix for [baf42ee135].</li>

</ul>
<p>
    <b>1.0.XXX.0 - March 2, 2018</b>
</p>
<ul>
    <li>Support extended result codes when messages are looked up without the SQLite core library.</li>
    <li>Override System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff].</li>







>







209
210
211
212
213
214
215
216
217
218
219
220
221
222
223

<p>
    <b>1.0.109.0 - May XX, 2018 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_23_0.html">SQLite 3.23.0</a>.</li>
    <li>Prevent GetSchemaTable from throwing InvalidCastException. Fix for [baf42ee135].</li>
    <li>Add GetFieldAffinity method to the SQLiteDataReader class.</li>
</ul>
<p>
    <b>1.0.XXX.0 - March 2, 2018</b>
</p>
<ul>
    <li>Support extended result codes when messages are looked up without the SQLite core library.</li>
    <li>Override System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff].</li>
Changes to www/news.wiki.
46
47
48
49
50
51
52

53
54
55
56
57
58
59

<p>
    <b>1.0.109.0 - May XX, 2018 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/releaselog/3_23_0.html|SQLite 3.23.0].</li>
    <li>Prevent GetSchemaTable from throwing InvalidCastException. Fix for [baf42ee135].</li>

</ul>
<p>
    <b>1.0.108.0 - March 2, 2018</b>
</p>
<ul>
    <li>Support extended result codes when messages are looked up without the SQLite core library.</li>
    <li>Override System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff].</li>







>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

<p>
    <b>1.0.109.0 - May XX, 2018 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/releaselog/3_23_0.html|SQLite 3.23.0].</li>
    <li>Prevent GetSchemaTable from throwing InvalidCastException. Fix for [baf42ee135].</li>
    <li>Add GetFieldAffinity method to the SQLiteDataReader class.</li>
</ul>
<p>
    <b>1.0.108.0 - March 2, 2018</b>
</p>
<ul>
    <li>Support extended result codes when messages are looked up without the SQLite core library.</li>
    <li>Override System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff].</li>