System.Data.SQLite

Check-in [d2d80220a8]
Login

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

Overview
Comment:Modify the result code handling performed by the SQLiteModuleNoop class in order to make it more flexible for use with derived classes. Rename the ReturnCode property of the SQLiteException class to ResultCode.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d2d80220a803e10851960e026e086967b5f0896e
User & Date: mistachkin 2013-06-26 02:20:18.062
Context
2013-06-26
03:18
Rename the SQLiteVirtualTableCursorEnumerable class to SQLiteVirtualTableCursorEnumerator. check-in: 4e38ea39a3 user: mistachkin tags: trunk
02:20
Modify the result code handling performed by the SQLiteModuleNoop class in order to make it more flexible for use with derived classes. Rename the ReturnCode property of the SQLiteException class to ResultCode. check-in: d2d80220a8 user: mistachkin tags: trunk
2013-06-25
21:50
Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for [9a544991be]. check-in: 2d35b79c48 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Doc/Extra/version.html.
45
46
47
48
49
50
51

52
53
54
55
56
57
58
    <h1 class="heading">Version History</h1>
    <p><b>1.0.87.0 - June XX, 2013 <font color="red">(release scheduled)</font></b></p>
    <ul>
      <li>Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for <a href="http://system.data.sqlite.org/index.html/info/9a544991be">[9a544991be]</a>.</li>
      <li>The DbType to type name translation needs to prioritize the Entity Framework type names. Fix for <a href="http://system.data.sqlite.org/index.html/info/47f4bac575">[47f4bac575]</a>.</li>
      <li>Add DateTimeFormatString connection string property to allow the DateTime format string used for all parsing and formatting to be overridden.</li>
      <li>Disable use of the new connection string parsing algorithm when the No_SQLiteConnectionNewParser environment variable is set. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/bbdda6eae2">[bbdda6eae2]</a>.</li>

    </ul>
    <p><b>1.0.86.0 - May 23, 2013</b></p>
    <ul>
      <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_17.html">SQLite 3.7.17</a>.</li>
      <li>Disable use of the AllowPartiallyTrustedCallers attribute when compiled for the .NET Framework 4.0/4.5.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Allow semi-colons in the data source file name. Fix for <a href="http://system.data.sqlite.org/index.html/info/48a6b8e4ca">[e47b3d8346]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>NULL values should be reported as type &quot;object&quot;, not &quot;DBNull&quot;. Fix for <a href="http://system.data.sqlite.org/index.html/info/48a6b8e4ca">[48a6b8e4ca]</a>.</li>







>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    <h1 class="heading">Version History</h1>
    <p><b>1.0.87.0 - June XX, 2013 <font color="red">(release scheduled)</font></b></p>
    <ul>
      <li>Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for <a href="http://system.data.sqlite.org/index.html/info/9a544991be">[9a544991be]</a>.</li>
      <li>The DbType to type name translation needs to prioritize the Entity Framework type names. Fix for <a href="http://system.data.sqlite.org/index.html/info/47f4bac575">[47f4bac575]</a>.</li>
      <li>Add DateTimeFormatString connection string property to allow the DateTime format string used for all parsing and formatting to be overridden.</li>
      <li>Disable use of the new connection string parsing algorithm when the No_SQLiteConnectionNewParser environment variable is set. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/bbdda6eae2">[bbdda6eae2]</a>.</li>
      <li>Rename the ReturnCode property of the SQLiteException class to ResultCode.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    </ul>
    <p><b>1.0.86.0 - May 23, 2013</b></p>
    <ul>
      <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_17.html">SQLite 3.7.17</a>.</li>
      <li>Disable use of the AllowPartiallyTrustedCallers attribute when compiled for the .NET Framework 4.0/4.5.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Allow semi-colons in the data source file name. Fix for <a href="http://system.data.sqlite.org/index.html/info/48a6b8e4ca">[e47b3d8346]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>NULL values should be reported as type &quot;object&quot;, not &quot;DBNull&quot;. Fix for <a href="http://system.data.sqlite.org/index.html/info/48a6b8e4ca">[48a6b8e4ca]</a>.</li>
Changes to System.Data.SQLite/SQLiteException.cs.
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
        info.AddValue("errorCode", _errorCode);

      base.GetObjectData(info, context);
    }
#endif

    /// <summary>
    /// Gets the associated SQLite return code for this exception as a
    /// <see cref="SQLiteErrorCode" />.  This property returns the same
    /// underlying value as the <see cref="ErrorCode" /> property.
    /// </summary>
    public SQLiteErrorCode ReturnCode
    {
      get { return _errorCode; }
    }

    /// <summary>
    /// Gets the associated SQLite return code for this exception as an
    /// <see cref="Int32" />.  For desktop versions of the .NET Framework,
    /// this property overrides the property of the same name within the
    /// <see cref="System.Runtime.InteropServices.ExternalException" />
    /// class.  This property returns the same underlying value as the
    /// <see cref="ReturnCode" /> property.
    /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
    public override int ErrorCode
#else
    public int ErrorCode
#endif
    {







|



|










|







111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
        info.AddValue("errorCode", _errorCode);

      base.GetObjectData(info, context);
    }
#endif

    /// <summary>
    /// Gets the associated SQLite result code for this exception as a
    /// <see cref="SQLiteErrorCode" />.  This property returns the same
    /// underlying value as the <see cref="ErrorCode" /> property.
    /// </summary>
    public SQLiteErrorCode ResultCode
    {
      get { return _errorCode; }
    }

    /// <summary>
    /// Gets the associated SQLite return code for this exception as an
    /// <see cref="Int32" />.  For desktop versions of the .NET Framework,
    /// this property overrides the property of the same name within the
    /// <see cref="System.Runtime.InteropServices.ExternalException" />
    /// class.  This property returns the same underlying value as the
    /// <see cref="ResultCode" /> property.
    /// </summary>
#if !PLATFORM_COMPACTFRAMEWORK
    public override int ErrorCode
#else
    public int ErrorCode
#endif
    {
Changes to System.Data.SQLite/SQLiteModuleEnumerable.cs.
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
            )
        {
            if (value == null)
                return 0;

            return value.GetHashCode();
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Converts a <see cref="SQLiteErrorCode" /> into a boolean return
        /// value for use with the <see cref="ISQLiteManagedModule.Eof" />
        /// method.
        /// </summary>
        /// <param name="returnCode">
        /// The <see cref="SQLiteErrorCode" /> value to convert.
        /// </param>
        /// <returns>
        /// The <see cref="Boolean" /> value.
        /// </returns>
        protected virtual bool CodeToEofResult(
            SQLiteErrorCode returnCode
            )
        {
            return (returnCode == SQLiteErrorCode.Ok) ? false : true;
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region ISQLiteManagedModule Members
        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Create" /> method.







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







343
344
345
346
347
348
349




















350
351
352
353
354
355
356
            )
        {
            if (value == null)
                return 0;

            return value.GetHashCode();
        }




















        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region ISQLiteManagedModule Members
        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Create" /> method.
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
        {
            CheckDisposed();

            SQLiteVirtualTableCursorEnumerable enumerableCursor =
                cursor as SQLiteVirtualTableCursorEnumerable;

            if (enumerableCursor == null)
                return CodeToEofResult(CursorTypeMismatchError(cursor));

            return enumerableCursor.EndOfEnumerator;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>







|







653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
        {
            CheckDisposed();

            SQLiteVirtualTableCursorEnumerable enumerableCursor =
                cursor as SQLiteVirtualTableCursorEnumerable;

            if (enumerableCursor == null)
                return ResultCodeToEofResult(CursorTypeMismatchError(cursor));

            return enumerableCursor.EndOfEnumerator;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
Changes to System.Data.SQLite/SQLiteModuleNoop.cs.
1
2
3
4
5
6
7


8
9
10
11
12
13
14











15
16
17
18
19
20
21
22
23
24
25
26



27




























































































































28
29
30
31
32
33
34
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Joe Mistachkin (joe@mistachkin.com)
 *
 * Released to the public domain, use at your own risk!
 ********************************************************/



namespace System.Data.SQLite
{
    /// <summary>
    /// This class implements a virtual table module that does nothing.
    /// </summary>
    public class SQLiteModuleNoop : SQLiteModule /* NOT SEALED */
    {











        #region Public Constructors
        /// <summary>
        /// Constructs an instance of this class.
        /// </summary>
        /// <param name="name">
        /// The name of the module.  This parameter cannot be null.
        /// </param>
        public SQLiteModuleNoop(
            string name
            )
            : base(name)
        {



            // do nothing.




























































































































        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region ISQLiteManagedModule Members
        /// <summary>







>
>







>
>
>
>
>
>
>
>
>
>
>












>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Joe Mistachkin (joe@mistachkin.com)
 *
 * Released to the public domain, use at your own risk!
 ********************************************************/

using System.Collections.Generic;

namespace System.Data.SQLite
{
    /// <summary>
    /// This class implements a virtual table module that does nothing.
    /// </summary>
    public class SQLiteModuleNoop : SQLiteModule /* NOT SEALED */
    {
        #region Private Data
        /// <summary>
        /// This field is used to store the <see cref="SQLiteErrorCode" />
        /// values to return, on a per-method basis, for all methods that are
        /// part of the <see cref="ISQLiteManagedModule" /> interface.
        /// </summary>
        private Dictionary<string, SQLiteErrorCode> resultCodes;
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Public Constructors
        /// <summary>
        /// Constructs an instance of this class.
        /// </summary>
        /// <param name="name">
        /// The name of the module.  This parameter cannot be null.
        /// </param>
        public SQLiteModuleNoop(
            string name
            )
            : base(name)
        {
            resultCodes = new Dictionary<string, SQLiteErrorCode>();
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region Protected Methods
        /// <summary>
        /// Determines the default <see cref="SQLiteErrorCode" /> value to be
        /// returned by methods of the <see cref="ISQLiteManagedModule" />
        /// interface that lack an overridden implementation in all classes
        /// derived from the <see cref="SQLiteModuleNoop" /> class.
        /// </summary>
        /// <returns>
        /// The <see cref="SQLiteErrorCode" /> value that should be returned
        /// by all <see cref="ISQLiteManagedModule" /> interface methods unless
        /// a more specific result code has been set for that interface method.
        /// </returns>
        protected virtual SQLiteErrorCode GetDefaultResultCode()
        {
            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Converts a <see cref="SQLiteErrorCode" /> value into a boolean
        /// return value for use with the
        /// <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </summary>
        /// <param name="resultCode">
        /// The <see cref="SQLiteErrorCode" /> value to convert.
        /// </param>
        /// <returns>
        /// The <see cref="Boolean" /> value.
        /// </returns>
        protected virtual bool ResultCodeToEofResult(
            SQLiteErrorCode resultCode
            )
        {
            return (resultCode == SQLiteErrorCode.Ok) ? false : true;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Converts a <see cref="SQLiteErrorCode" /> value into a boolean
        /// return value for use with the
        /// <see cref="ISQLiteManagedModule.FindFunction" /> method.
        /// </summary>
        /// <param name="resultCode">
        /// The <see cref="SQLiteErrorCode" /> value to convert.
        /// </param>
        /// <returns>
        /// The <see cref="Boolean" /> value.
        /// </returns>
        protected virtual bool ResultCodeToFindFunctionResult(
            SQLiteErrorCode resultCode
            )
        {
            return (resultCode == SQLiteErrorCode.Ok) ? true : false;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Determines the <see cref="SQLiteErrorCode" /> value that should be
        /// returned by the specified <see cref="ISQLiteManagedModule" />
        /// interface method if it lack an overridden implementation.  If no
        /// specific <see cref="SQLiteErrorCode" /> value is available (or set)
        /// for the specified method, the <see cref="SQLiteErrorCode" /> value
        /// returned by the <see cref="GetDefaultResultCode" /> method will be
        /// returned instead.
        /// </summary>
        /// <param name="methodName">
        /// The name of the method.  Currently, this method must be part of
        /// the <see cref="ISQLiteManagedModule" /> interface.
        /// </param>
        /// <returns>
        /// The <see cref="SQLiteErrorCode" /> value that should be returned
        /// by the <see cref="ISQLiteManagedModule" /> interface method.
        /// </returns>
        protected virtual SQLiteErrorCode GetMethodResultCode(
            string methodName
            )
        {
            if ((methodName == null) || (resultCodes == null))
                return GetDefaultResultCode();

            SQLiteErrorCode resultCode;

            if ((resultCodes != null) &&
                resultCodes.TryGetValue(methodName, out resultCode))
            {
                return resultCode;
            }

            return GetDefaultResultCode();
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Sets the <see cref="SQLiteErrorCode" /> value that should be
        /// returned by the specified <see cref="ISQLiteManagedModule" />
        /// interface method if it lack an overridden implementation.
        /// </summary>
        /// <param name="methodName">
        /// The name of the method.  Currently, this method must be part of
        /// the <see cref="ISQLiteManagedModule" /> interface.
        /// </param>
        /// <param name="resultCode">
        /// The <see cref="SQLiteErrorCode" /> value that should be returned
        /// by the <see cref="ISQLiteManagedModule" /> interface method.
        /// </param>
        /// <returns>
        /// Non-zero upon success.
        /// </returns>
        protected virtual bool SetMethodResultCode(
            string methodName,
            SQLiteErrorCode resultCode
            )
        {
            if ((methodName == null) || (resultCodes == null))
                return false;

            resultCodes[methodName] = resultCode;
            return true;
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region ISQLiteManagedModule Members
        /// <summary>
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
            string[] arguments,
            ref SQLiteVirtualTable table,
            ref string error
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Connect" /> method.
        /// </summary>







|







198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
            string[] arguments,
            ref SQLiteVirtualTable table,
            ref string error
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Create");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Connect" /> method.
        /// </summary>
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
            string[] arguments,
            ref SQLiteVirtualTable table,
            ref string error
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.BestIndex" /> method.
        /// </summary>







|







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
            string[] arguments,
            ref SQLiteVirtualTable table,
            ref string error
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Connect");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.BestIndex" /> method.
        /// </summary>
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
        public override SQLiteErrorCode BestIndex(
            SQLiteVirtualTable table,
            SQLiteIndex index
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
        /// </returns>
        public override SQLiteErrorCode Disconnect(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
        /// </returns>
        public override SQLiteErrorCode Destroy(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Open" /> method.
        /// </summary>







|



















|



















|







258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
        public override SQLiteErrorCode BestIndex(
            SQLiteVirtualTable table,
            SQLiteIndex index
            )
        {
            CheckDisposed();

            return GetMethodResultCode("BestIndex");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Disconnect" /> method.
        /// </returns>
        public override SQLiteErrorCode Disconnect(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Disconnect");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Destroy" /> method.
        /// </returns>
        public override SQLiteErrorCode Destroy(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Destroy");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Open" /> method.
        /// </summary>
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
        public override SQLiteErrorCode Open(
            SQLiteVirtualTable table,
            ref SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Close" /> method.
        /// </summary>
        /// <param name="cursor">
        /// See the <see cref="ISQLiteManagedModule.Close" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Close" /> method.
        /// </returns>
        public override SQLiteErrorCode Close(
            SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Filter" /> method.
        /// </summary>







|



















|







322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
        public override SQLiteErrorCode Open(
            SQLiteVirtualTable table,
            ref SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Open");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Close" /> method.
        /// </summary>
        /// <param name="cursor">
        /// See the <see cref="ISQLiteManagedModule.Close" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Close" /> method.
        /// </returns>
        public override SQLiteErrorCode Close(
            SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Close");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Filter" /> method.
        /// </summary>
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
            int indexNumber,
            string indexString,
            SQLiteValue[] values
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Next" /> method.
        /// </summary>
        /// <param name="cursor">
        /// See the <see cref="ISQLiteManagedModule.Next" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Next" /> method.
        /// </returns>
        public override SQLiteErrorCode Next(
            SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </summary>
        /// <param name="cursor">
        /// See the <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </returns>
        public override bool Eof(
            SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return true;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Column" /> method.
        /// </summary>







|



















|



















|







374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
            int indexNumber,
            string indexString,
            SQLiteValue[] values
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Filter");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Next" /> method.
        /// </summary>
        /// <param name="cursor">
        /// See the <see cref="ISQLiteManagedModule.Next" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Next" /> method.
        /// </returns>
        public override SQLiteErrorCode Next(
            SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Next");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </summary>
        /// <param name="cursor">
        /// See the <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Eof" /> method.
        /// </returns>
        public override bool Eof(
            SQLiteVirtualTableCursor cursor
            )
        {
            CheckDisposed();

            return ResultCodeToEofResult(GetMethodResultCode("Eof"));
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Column" /> method.
        /// </summary>
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
            SQLiteVirtualTableCursor cursor,
            SQLiteContext context,
            int index
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.RowId" /> method.
        /// </summary>







|







442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
            SQLiteVirtualTableCursor cursor,
            SQLiteContext context,
            int index
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Column");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.RowId" /> method.
        /// </summary>
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
        public override SQLiteErrorCode RowId(
            SQLiteVirtualTableCursor cursor,
            ref long rowId
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Update" /> method.
        /// </summary>







|







466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
        public override SQLiteErrorCode RowId(
            SQLiteVirtualTableCursor cursor,
            ref long rowId
            )
        {
            CheckDisposed();

            return GetMethodResultCode("RowId");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Update" /> method.
        /// </summary>
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
            SQLiteVirtualTable table,
            SQLiteValue[] values,
            ref long rowId
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Begin" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Begin" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Begin" /> method.
        /// </returns>
        public override SQLiteErrorCode Begin(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Sync" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Sync" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Sync" /> method.
        /// </returns>
        public override SQLiteErrorCode Sync(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Commit" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Commit" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Commit" /> method.
        /// </returns>
        public override SQLiteErrorCode Commit(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
        /// </returns>
        public override SQLiteErrorCode Rollback(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
        /// </summary>







|



















|



















|



















|



















|







494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
            SQLiteVirtualTable table,
            SQLiteValue[] values,
            ref long rowId
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Update");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Begin" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Begin" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Begin" /> method.
        /// </returns>
        public override SQLiteErrorCode Begin(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Begin");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Sync" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Sync" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Sync" /> method.
        /// </returns>
        public override SQLiteErrorCode Sync(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Sync");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Commit" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Commit" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Commit" /> method.
        /// </returns>
        public override SQLiteErrorCode Commit(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Commit");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
        /// </summary>
        /// <param name="table">
        /// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
        /// </param>
        /// <returns>
        /// See the <see cref="ISQLiteManagedModule.Rollback" /> method.
        /// </returns>
        public override SQLiteErrorCode Rollback(
            SQLiteVirtualTable table
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Rollback");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.FindFunction" /> method.
        /// </summary>
470
471
472
473
474
475
476
477

478
479
480
481
482
483
484
            string name,
            ref SQLiteFunction function,
            ref IntPtr pClientData
            )
        {
            CheckDisposed();

            return false;

        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Rename" /> method.
        /// </summary>







|
>







610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
            string name,
            ref SQLiteFunction function,
            ref IntPtr pClientData
            )
        {
            CheckDisposed();

            return ResultCodeToFindFunctionResult(GetMethodResultCode(
                "FindFunction"));
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Rename" /> method.
        /// </summary>
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
        public override SQLiteErrorCode Rename(
            SQLiteVirtualTable table,
            string newName
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Savepoint" /> method.
        /// </summary>







|







635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
        public override SQLiteErrorCode Rename(
            SQLiteVirtualTable table,
            string newName
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Rename");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Savepoint" /> method.
        /// </summary>
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
        public override SQLiteErrorCode Savepoint(
            SQLiteVirtualTable table,
            int savepoint
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Release" /> method.
        /// </summary>







|







659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
        public override SQLiteErrorCode Savepoint(
            SQLiteVirtualTable table,
            int savepoint
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Savepoint");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.Release" /> method.
        /// </summary>
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
        public override SQLiteErrorCode Release(
            SQLiteVirtualTable table,
            int savepoint
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.RollbackTo" /> method.
        /// </summary>







|







683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
        public override SQLiteErrorCode Release(
            SQLiteVirtualTable table,
            int savepoint
            )
        {
            CheckDisposed();

            return GetMethodResultCode("Release");
        }

        ///////////////////////////////////////////////////////////////////////

        /// <summary>
        /// See the <see cref="ISQLiteManagedModule.RollbackTo" /> method.
        /// </summary>
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
        public override SQLiteErrorCode RollbackTo(
            SQLiteVirtualTable table,
            int savepoint
            )
        {
            CheckDisposed();

            return SQLiteErrorCode.Ok;
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region IDisposable "Pattern" Members
        private bool disposed;







|







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
        public override SQLiteErrorCode RollbackTo(
            SQLiteVirtualTable table,
            int savepoint
            )
        {
            CheckDisposed();

            return GetMethodResultCode("RollbackTo");
        }
        #endregion

        ///////////////////////////////////////////////////////////////////////

        #region IDisposable "Pattern" Members
        private bool disposed;
Changes to Tests/basic.eagle.
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836

  $serializer Serialize $stream $exception(1)

  $stream Seek 0 Begin

  set exception(2) [$serializer -alias Deserialize $stream]

  list [$exception(1) ReturnCode] [$exception(1) Message] \
      [$exception(2) ReturnCode] [$exception(2) Message] \
      [expr {[$exception(1) ReturnCode] eq [$exception(2) ReturnCode]}] \
      [expr {[$exception(1) Message] eq [$exception(2) Message]}]
} -cleanup {
  unset -nocomplain exception stream serializer
} -constraints {eagle SQLite System.Data.SQLite} -result \
[string map [list \n \r\n] {CantOpen {unable to open database file
this is a test} CantOpen {unable to open database file
this is a test} True True}]}







|
|
|







1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836

  $serializer Serialize $stream $exception(1)

  $stream Seek 0 Begin

  set exception(2) [$serializer -alias Deserialize $stream]

  list [$exception(1) ResultCode] [$exception(1) Message] \
      [$exception(2) ResultCode] [$exception(2) Message] \
      [expr {[$exception(1) ResultCode] eq [$exception(2) ResultCode]}] \
      [expr {[$exception(1) Message] eq [$exception(2) Message]}]
} -cleanup {
  unset -nocomplain exception stream serializer
} -constraints {eagle SQLite System.Data.SQLite} -result \
[string map [list \n \r\n] {CantOpen {unable to open database file
this is a test} CantOpen {unable to open database file
this is a test} True True}]}
Changes to Tests/vtab.eagle.
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186

              try
              {
                command.ExecuteNonQuery();
              }
              catch (SQLiteException e)
              {
                result.Add(e.ReturnCode.ToString());
                result.Add(e.Message);
              }
            }

            connection.Close();
          }








|







172
173
174
175
176
177
178
179
180
181
182
183
184
185
186

              try
              {
                command.ExecuteNonQuery();
              }
              catch (SQLiteException e)
              {
                result.Add(e.ResultCode.ToString());
                result.Add(e.Message);
              }
            }

            connection.Close();
          }

Changes to readme.htm.
190
191
192
193
194
195
196

197
198
199
200
201
202
203
    <b>1.0.87.0 - June XX, 2013 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for [9a544991be].</li>
    <li>The DbType to type name translation needs to prioritize the Entity Framework type names. Fix for [47f4bac575].</li>
    <li>Add DateTimeFormatString connection string property to allow the DateTime format string used for all parsing and formatting to be overridden.</li>
    <li>Disable use of the new connection string parsing algorithm when the No_SQLiteConnectionNewParser environment variable is set. Pursuant to [bbdda6eae2].</li>

</ul>
<p>
    <b>1.0.86.0 - May 23, 2013</b>
</p>
<ul>
    <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_17.html">SQLite 3.7.17</a>.</li>
    <li>Disable use of the AllowPartiallyTrustedCallers attribute when compiled for the .NET Framework 4.0/4.5.&nbsp;<b>** Potentially Incompatible Change **</b></li>







>







190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
    <b>1.0.87.0 - June XX, 2013 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for [9a544991be].</li>
    <li>The DbType to type name translation needs to prioritize the Entity Framework type names. Fix for [47f4bac575].</li>
    <li>Add DateTimeFormatString connection string property to allow the DateTime format string used for all parsing and formatting to be overridden.</li>
    <li>Disable use of the new connection string parsing algorithm when the No_SQLiteConnectionNewParser environment variable is set. Pursuant to [bbdda6eae2].</li>
    <li>Rename the ReturnCode property of the SQLiteException class to ResultCode.&nbsp;<b>** Potentially Incompatible Change **</b></li>
</ul>
<p>
    <b>1.0.86.0 - May 23, 2013</b>
</p>
<ul>
    <li>Updated to <a href="http://www.sqlite.org/releaselog/3_7_17.html">SQLite 3.7.17</a>.</li>
    <li>Disable use of the AllowPartiallyTrustedCallers attribute when compiled for the .NET Framework 4.0/4.5.&nbsp;<b>** Potentially Incompatible Change **</b></li>
Changes to www/news.wiki.
1
2
3
4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
<title>News</title>

<b>Version History</b>

<p>
    <b>1.0.87.0 - June XX, 2013 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for [9a544991be].</li>
    <li>The DbType to type name translation needs to prioritize the Entity Framework type names. Fix for [47f4bac575].</li>
    <li>Add DateTimeFormatString connection string property to allow the DateTime format string used for all parsing and formatting to be overridden.</li>
    <li>Disable use of the new connection string parsing algorithm when the No_SQLiteConnectionNewParser environment variable is set. Pursuant to [bbdda6eae2].</li>

</ul>
<p>
    <b>1.0.86.0 - May 23, 2013</b>
</p>
<ul>
    <li>Updated to [http://www.sqlite.org/releaselog/3_7_17.html|SQLite 3.7.17].</li>
    <li>Disable use of the AllowPartiallyTrustedCallers attribute when compiled for the .NET Framework 4.0/4.5.&nbsp;<b>** Potentially Incompatible Change **</b></li>












>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<title>News</title>

<b>Version History</b>

<p>
    <b>1.0.87.0 - June XX, 2013 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Add all the necessary infrastructure to allow virtual tables to be implemented in managed code. Fix for [9a544991be].</li>
    <li>The DbType to type name translation needs to prioritize the Entity Framework type names. Fix for [47f4bac575].</li>
    <li>Add DateTimeFormatString connection string property to allow the DateTime format string used for all parsing and formatting to be overridden.</li>
    <li>Disable use of the new connection string parsing algorithm when the No_SQLiteConnectionNewParser environment variable is set. Pursuant to [bbdda6eae2].</li>
    <li>Rename the ReturnCode property of the SQLiteException class to ResultCode.&nbsp;<b>** Potentially Incompatible Change **</b></li>
</ul>
<p>
    <b>1.0.86.0 - May 23, 2013</b>
</p>
<ul>
    <li>Updated to [http://www.sqlite.org/releaselog/3_7_17.html|SQLite 3.7.17].</li>
    <li>Disable use of the AllowPartiallyTrustedCallers attribute when compiled for the .NET Framework 4.0/4.5.&nbsp;<b>** Potentially Incompatible Change **</b></li>