System.Data.SQLite

Check-in [dba40334e2]
Login

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

Overview
Comment:1.08
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: dba40334e2885205102c55a67d9a23b37b2ebfbd
User & Date: rmsimpson 2005-03-11 23:16:49.000
Context
2005-03-22
14:54
SQLite 3.2 code merge check-in: 4f0102b290 user: rmsimpson tags: sourceforge
2005-03-11
23:16
1.08 check-in: dba40334e2 user: rmsimpson tags: sourceforge
21:39
1.08 check-in: 40c497decf user: rmsimpson tags: sourceforge
Changes
Unified Diff Ignore Whitespace Patch
Changes to readme.htm.
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
    ADO.NET 2.0 SQLite Data Provider<br />
    Version 1.0.7 - Mar 5, 2005<br />

    Written by Robert Simpson (<a href="mailto:robert@blackcastlesoft.com">robert@blackcastlesoft.com</a>)<br />
    Released to the public domain, use at your own risk!<br />
    <br />
    This provider was written and verified using the Visual Studio 2005 February CTP,
    but will compile without error on previous VS2005 releases..<br />
    <br />
    The latest version can be downloaded <a href="http://sourceforge.net/projects/sqlite-dotnet2">here</a>
    <br />
    <br />



    <b>Features:</b><br />

    <ul>
      <li>DbProviderFactory support, just add the XML below at the machine.config and/or app.config level. </li>
      <li>Full support for ATTACH'ed databases.&nbsp; Exposed as <i>Catalogs</i> in the
        schema.&nbsp; When cloning a connection, all attached databases are automatically
        re-attached to the new connection.</li>
      <li>DbConnection.GetSchema(...) support includes the <i>MetaDataCollections</i>, <i>
        DataSourceInformation</i>, <i>Columns</i>, <i>Tables</i>, <i>Views</i>, <i>Catalogs</i>
        and <i>Indexes</i> keywords.</li>
      <li>Enhanced DbDataReader.GetSchemaTable() functionality returns catalog, namespace
        and detailed schema information even for complex queries.</li>
      <li>Named and unnamed parameters.</li>
      <li>Full UTF-8 and UTF-16 support.</li>
      <li>Multiple simultaneous DataReaders (one DataReader per Command however).</li>
      <li>Full support for user-defined scalar and aggregate functions, encapsulated into
        an
        easy-to-use base class in which only a couple of overrides are necessary to implement
        new SQL functions.</li>
      <li>Full support for user-defined collating sequences, every bit as simple to implement
        as user-defined functions and uses the same base class.</li></ul>



    In order to use the SQLiteFactory and have the SQLite data provider enumerated in
    the DbProviderFactories methods, you must add the following segment into either
    your application's app.config or the system's machine.config located in the %SystemRoot%\Microsoft.Net\Framework\v2.xxxx\Config
    folder:<br />
    <br />
    <pre>
&lt;configuration&gt;
  &lt;system.data&gt;
    &lt;DbProviderFactories&gt;
      &lt;add name="SQLite Data Provider" invariant="System.Data.SQLite" support="3F" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /&gt;
    &lt;/DbProviderFactories&gt;
  &lt;/system.data&gt;
&lt;/configuration&gt;
</pre>
    <br />
    <b>Development Notes Regarding the SQLite 3 Source Code<br />
    </b>*** At this time, the necessary changes to the DLL to support Windows CE have
    not been completed.&nbsp; All function calls that return or pass a 64-bit value
    have been wrapped, but the necessary OS changes have not been finished.<br />



    <br />













      <p></p>
    <p>
      Steps for merging the sqlite3 core codebase:</p>
    <ol>
      <li>Download the latest sqlite3 source from <a href="http://www.sqlite.org/download.html">
        http://www.sqlite.org/download.html</a></li>
      <li>Extract the source code to the <b>SQLite.Interop\src</b> directory of this project</li>
      <li>Open the <b>src\select.c</b> file.</li>
      <li>Add <b>#include "../interop.h" </b>to the top of the file where the other include's
        are.</li>
      <li>Scroll down the <b>select.c</b> file to around line <b>748</b>.&nbsp; Change the name of the function <b>static void generateColumnNames </b>to
    <b>static void _generateColumnNames</b> (<i>note the underscore in front of the name</i>).</li>
      <li>Compile it.</li>
    </ol>



      <b>Version History<br />
        1.07 - Mar 5, 2005<br />
      </b>
    <ul>





      <li>Made more optimizations to frequently-called functions, resulting in significant
        performance gains in all tests.</li>

      <li>Recompiled the binaries using the latest VS2005 February CTP, resulting in yet
        more significant speed gains.&nbsp; The 100k insert test used to take 3.5 seconds
        and the insertwithidentity took almost 8 seconds.&nbsp; With the above two changes,
        those tests are now executing in 1.9 and 4.9 seconds respectively.</li>
    </ul>
    <b>
      <br />
        1.06 - Mar 1, 2005<br />
    </b>

    <ul>
      <li>Speed-ups to SQLiteDataReader.&nbsp; It was interop'ing every time it tried to
        fetch a field due to a logic error.</li>
      <li>Changed/Added some code to SQLiteConvert's internal DbType, Type and TypeAffinity
        functions.</li>
      <li>Fixed the SQLiteDataReader to obey the flags set in the optional CommandBehavior
        flag from SQLiteCommand.ExecuteReader().</li>
		<li>Changed the default page size to 1024 to reflect the defaults of 
		SQLite.&nbsp; Ignores the &quot;Page Size&quot; connection string option for 







|
>



|
|





>
>
|
>



















>
>
>















|
|
|
|
>
>
>

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














>
>
>
|
|
|

>
>
>
>
>
|
|
>
|
|
|
|
<
|
<

|
>

|







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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title></title>
	</head>
	<body>
    ADO.NET 2.0 SQLite Data Provider<br />
    Version 1.0.8 - Mar 11, 2005<br />
    Interop using SQLite 3.14<br />
    Written by Robert Simpson (<a href="mailto:robert@blackcastlesoft.com">robert@blackcastlesoft.com</a>)<br />
    Released to the public domain, use at your own risk!<br />
    <br />
    This provider was written and verified using the Visual Studio 2005 November, December
    and February 2005 CTP's.<br />
    <br />
    The latest version can be downloaded <a href="http://sourceforge.net/projects/sqlite-dotnet2">here</a>
    <br />
    <br />

    <b></b>
    <h2>
      <b>Features:</b><br />
    </h2>
    <ul>
      <li>DbProviderFactory support, just add the XML below at the machine.config and/or app.config level. </li>
      <li>Full support for ATTACH'ed databases.&nbsp; Exposed as <i>Catalogs</i> in the
        schema.&nbsp; When cloning a connection, all attached databases are automatically
        re-attached to the new connection.</li>
      <li>DbConnection.GetSchema(...) support includes the <i>MetaDataCollections</i>, <i>
        DataSourceInformation</i>, <i>Columns</i>, <i>Tables</i>, <i>Views</i>, <i>Catalogs</i>
        and <i>Indexes</i> keywords.</li>
      <li>Enhanced DbDataReader.GetSchemaTable() functionality returns catalog, namespace
        and detailed schema information even for complex queries.</li>
      <li>Named and unnamed parameters.</li>
      <li>Full UTF-8 and UTF-16 support.</li>
      <li>Multiple simultaneous DataReaders (one DataReader per Command however).</li>
      <li>Full support for user-defined scalar and aggregate functions, encapsulated into
        an
        easy-to-use base class in which only a couple of overrides are necessary to implement
        new SQL functions.</li>
      <li>Full support for user-defined collating sequences, every bit as simple to implement
        as user-defined functions and uses the same base class.</li></ul>
    <strong></strong>
    <h2>
      <strong>Compiling:</strong></h2>
    In order to use the SQLiteFactory and have the SQLite data provider enumerated in
    the DbProviderFactories methods, you must add the following segment into either
    your application's app.config or the system's machine.config located in the %SystemRoot%\Microsoft.Net\Framework\v2.xxxx\Config
    folder:<br />
    <br />
    <pre>
&lt;configuration&gt;
  &lt;system.data&gt;
    &lt;DbProviderFactories&gt;
      &lt;add name="SQLite Data Provider" invariant="System.Data.SQLite" support="3F" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /&gt;
    &lt;/DbProviderFactories&gt;
  &lt;/system.data&gt;
&lt;/configuration&gt;
</pre>
    <br />
    <h3>
      Compiling for Beta 1:</h3>
    The <strong>System.Data.SQLite</strong> project was compiled using the November/December/February
    CTP's of Visual Studio 2005, but it can be compiled with some trivial effort on
    the previous Beta 1 edition of VS2005.&nbsp; Just right-click the <strong>System.Data.SQLite</strong>
    project, select <strong>Properties</strong>, go to the <strong>Build</strong> tab,
    and add <strong>BETA1</strong> to the conditional compilation symbols.<br />
    <br />
    <h3>
      Compiling for the Compact Framework</h3>
    <p>
      The SQLite.Interop.DLL does not (yet) support a build that includes Windows CE processor
      architectures.&nbsp; I am aware of the CE port of SQLite and will be investigating
      their code to see how best to proceed in that regard.&nbsp; I am also waiting for
      the newer version of SQLite to become available which will offer select metadata
      information and will cause a major redesign of this library to support it.<br />
    <b>
    </b>
    </p>
    <h2>
      <b>Development Notes Regarding the SQLite 3 Source Code</b></h2>
      <p></p>
    <p>
      Steps for merging the sqlite3 core codebase:</p>
    <ol>
      <li>Download the latest sqlite3 source from <a href="http://www.sqlite.org/download.html">
        http://www.sqlite.org/download.html</a></li>
      <li>Extract the source code to the <b>SQLite.Interop\src</b> directory of this project</li>
      <li>Open the <b>src\select.c</b> file.</li>
      <li>Add <b>#include "../interop.h" </b>to the top of the file where the other include's
        are.</li>
      <li>Scroll down the <b>select.c</b> file to around line <b>748</b>.&nbsp; Change the name of the function <b>static void generateColumnNames </b>to
    <b>static void _generateColumnNames</b> (<i>note the underscore in front of the name</i>).</li>
      <li>Compile it.</li>
    </ol>
      <b>
      </b>
    <h2>
      <b>Version History</b></h2>
    <b>1.08 - Mar 11, 2005<br />
    </b>
    <ul>
      <li>Added additional #if statements to support the old beta 1 edition of VS2005.</li>
      <li>Code merged the SQLite 3.14 source.</li>
    </ul>
    <b>1.07 - Mar 5, 2005</b><br />
      <ul>
        <li>Made more optimizations to frequently-called functions, resulting in significant
          performance gains in all tests. </li>
        <li>
      Recompiled the binaries using the latest VS2005 February CTP, resulting in yet more
      significant speed gains.&nbsp; The 100k insert test used to take 3.5 seconds and
      the insertwithidentity took almost 8 seconds.&nbsp; With the above two changes,
      those tests are now executing in 1.9 and 4.9 seconds respectively.</LI></UL><p>

        <b>

        1.06 - Mar 1, 2005<br />
        </b>
      </p>
    <ul>
      <li>Speed-ups to SQLiteDataReader.&nbsp; It was interop'ing unnecessarily every time it tried to
        fetch a field due to a logic error.</li>
      <li>Changed/Added some code to SQLiteConvert's internal DbType, Type and TypeAffinity
        functions.</li>
      <li>Fixed the SQLiteDataReader to obey the flags set in the optional CommandBehavior
        flag from SQLiteCommand.ExecuteReader().</li>
		<li>Changed the default page size to 1024 to reflect the defaults of 
		SQLite.&nbsp; Ignores the &quot;Page Size&quot; connection string option for