ADO.NET Data Provider for SQLite http://sourceforge.net/projects/adodotnetsqlite Finisar Corporation is releasing this software as free, open source software to complement the excellent work that is SQLite. This software is covered under the BSD open source license, included in a separate file. As such, there are no limitations on its use or modification, as long as the appropriate copyright acknowledgement is preserved. The embedded SQLite code is, of course, public domain. Tim McDaniel (spacedog69@users.sourceforge.net) Project Admin Notes regarding the implementation of ISO8601 DateTime fields (introduced February 12, 2005): ------------------ Release 0.21 saw the introduction of ISO8601 DateTime fields as the default storage mechanism. The format used was 'yyyy-MM-dd HH-mm-ss', to bring it in line with SQLite 3.1.1's new CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP keywords. This is also the the default format used by MySQL. Other supported formats at this time include: * yyyyMMddHHmmss * yyyyMMddTHHmmssfffffff * yyyy-MM-dd * yy-MM-dd * yyyyMMdd * HH:mm:ss * THHmmss For more details on ISO8601 Date Formats, visit http://www.cl.cam.ac.uk/~mgk25/iso-time.html. Robert Foster (robertjf@users.sourceforge.net) Project Admin (February 12, 2005) History ------- Version 0.22 (February 12, 2005) - The option 'Compatibility=old-date-format' is supported for SQLite3 (bug 1039173). - CREATE TRIGGER can be executed now (bug 1041924). - Added methods and properties returning objects from Finisar.SQLite namespace, not only generic interfaces (bug 1051388, patch 1029075). - GetBoolean returns True if the string 'True' was written in the field (bug 1051867). - The declaration of the column as REAL is interpreted as Double instead of Float (bug 1045387). - DataAdapter/CommandBuilder handle BLOB correctly (bug 1054514). - BLOB is encoded/decoded for SQLite2 using sqlite_encode/decode_binary functions. It means BLOB can contain any characters including zeros and quotas. The side effect of this change is that the internal represenation of BLOB is changed. If you want the old represenation, you need to add 'Compatibility=old-binary-format' into the connection string. - The column definition containing the string 'BINARY' is equivalent to BLOB now. - Malformed SQL queries doesn't crash the provider (bug 1062822) - More sane handling of datatypes. The type of the column is determined first by the definition in the CREATE TABLE statement, falling back on the data itself if the definition isn't available (using Views, for example). - Added support for ISO8601 DateTime fields for both SQLite2 and SQLite3. New Connection String option is: DateTimeFormat=ISO8601|Ticks|CurrentCulture (default: ISO8601) This change means that existing applications will need to put DateTimeFormat=Ticks in their Connection String if they are currently _not_ using the Compatibilty=old-date-format. Version 0.20 (September 28, 2004) - Compact Framework is fully supported! It passes all unit tests. - Changed the internal format of DateTime. Now it is stored as Int64 instead of String. The old format is supported for SQLite2 via the option 'Compatibility=old-date-format' - Exceptions thrown in DbDataAdapter.Fill doesn't leave IDbConnection in 'Executing' state anymore - Decimal, Single, Double types are written in culture-neutral manner now. - Binary type (BLOB) is supported now. The SQLite of version 3 supports BLOB fully. SQLite version 2 doesn't allow bytes with zero values inside the binary array. The provider checks of the presence of zero bytes and throws exception if found them. - Preliminary support of Mono on UNIX is added. I didn't test it yet. Any volunteers? - Assembly is digitally signed. Version 0.19 (August 04, 2004) - Supports SQLite version 2 and 3 in the same code. - Added 'Version' option to the connection string. You have to add 'Version=3' to the connection string to work with SQLite3.dll. 'Version=2' forces SQLite.NET to work with SQLite.dll (which is SQLite2, actually). The default value of this option is 2. Version 0.18 (July 01, 2004) - Allows reusing connections. Now it's possible to close and open the connection object again and reuse all commands attached to this connection object. - Added constructors to SQLiteDataAdapter to conform with constructors of SqlDataAdapter for MS SQL Server. It was done to ease porting of the code from MS SQL Server to SQLite. - Fixed bug that didn't allow the creation of nested SQLiteDataReader from the same connection object. - Implemented SQLiteCommandBuilder. It builds Insert/Update/DeleteCommand for SQLiteDataAdapter automatically using the information from SelectCommand. The functionality is similar to SqlCommandBuilder for MS SQL Server. Version 0.17 (June 24, 2004) - C++ sources are converted to C#. Now SQLite.NET requires the presense of the native sqlite.dll. SQLite.NET.dll became completely managed. The separation of managed and native DLLs was done in the anticipation of PocketPC version of SQLite and SQLite.NET. - Added one more option to the connection string. The option is called 'UTF8Encoding' and could be True or False. If the option is True, results returned from SQLite are considered UTF8-encoded. If the option is False, results are considered ASCII-encoded. In both cases, the appropriate conversion is performed to get resulting UTF18/UCS2 managed String. The default value of this option is False. Version 0.16 (June 14, 2004) - Database schema changes are allowed inside the one command, like this: "CREATE TABLE t (a); INSERT INTO t a VALUES (1);" - Corrected the bug disabling UPDATE command right after executing of SQLiteDataReader. Version 0.15 (June 04, 2004) - The assigment of IDbTransaction to SQLiteCommand is supported now. Version 0.14 (May 13, 2004) - Fixed bug in SQLiteDataReader which didn't allow to use SQLiteDataAdapter.Update function. - SQLiteConnection can serve several opened SQLiteDataReaders simultaneously now. Version 0.13 (Apr 18, 2004) - Fixed bug in SQLiteDataReader.Item property. It was only returning String, instead of the appropriate type based on the type of the column. Version 0.12 (Mar 31, 2004) - Thanks go to Alexander Gavrilov for ALL the improvements in this release. - Named paremeters are implemented. They are very similar to named parameters in System.Data.SqlClient namespace. See UnitTests\ParameterTests.cs for examples. Note that this implementation does not create parameters automatically anymore and it breaks the existing code. To ease the transition from the previous version, the helper function CreateAndAddUnnamedParameters was written. This function could be called right after CommandText is assigned. The function creates and adds necessary unnamed parameters as it was in the previous version. - Batch of SQL statements separated by semicolons is now supported by SQLiteCommand and SQLiteDataReader. To step between results of individual statements, you have to use the 'NextResult' method of SQLiteDataReader (which is the implementation of IDataReader interface). - SQLiteParameter implements IDbDataParameter interface. - SQLiteDataReader implements IEnumerable interface. It allows using of SQLiteDataReader as the data source in controls such as DataGrid, Repeater and etc. - The requirements to the format of the connection string were relaxed. Now it ignores whitespaces around parameter names and values, allows semicolons at the and of the string and etc. - The project for unit tests was added into the solution. It requires NUnit (http://www.nunit.org) to be installed. SQLite.NET itself doesn't require NUnit. Version 0.11 (Mar 20, 2004) - Updated SQLite code to official 2.8.13 version. - Fixed bug where closing connection before all commands were disposed would result in database file not being released properly. - ExecuteNonQuery now calls sqlite_last_statement_changes to return count of row changes. - Added Unicode build and code to allow storing Unicode text in database. Note that there is a performance hit when using the Unicode version versus the non-Unicode version because of the more complex conversion between SQLite's UTF8 encoding and .NET's UTF16/UCS2 encoding. Unicode database size will increase as well. Opening non-Unicode databases with the Unicode library and vice-versa is untested. Version 0.10 (Mar 14, 2004) - [assembly:AssemblyDelaySignAttribute(true)] - Test.cs demonstrates use of generic IDb... interfaces instead of SQLite... classes. Version 0.9 (Feb 9, 2004) - Updated SQLite code to official 2.8.12 version. - Fixed bug in SQLiteConnection where it was not handling the "New" connection parameter properly. Version 0.8 (Jan 30, 2004) - Fixed bug with SQLiteCommand that would count '?'s inside strings in SQL statements as parameters, causing the parameter count to be wrong. Thanks to Mark Reid for the fix. Version 0.7 (Jan 17, 2004) - Updated SQLite code to official 2.8.11 version. - Fixed problem with SQLiteDataReader interpreting typeless columns as Double. It now interprets typeless columns as String, avoiding a possible FormatException from Double.Parse(). - Fixed bug in SQLiteDataReader.Close(), which would throw an InvalidOperationException if the connection was closed/destroyed before the reader was closed/destroyed. - Implemented GetChars and GetBytes on SQLiteDataReader, although they are untested. Version 0.6 (Jan 6, 2004) - Updated SQLite code to official 2.8.9 version. Version 0.5 (Jan 5, 2004) - SQLiteDataReader.GetValue() now correctly returns DBNull.Value when the db field is null. This fixes the problem with SQLiteDataAdapter and null fields. Version 0.4 (Dec 18, 2003) - Updated SQLite code to official 2.8.8 version. Version 0.3 (Dec 4, 2003) - Updated SQLite code to official 2.8.7 version. - Merged SQLite.dll code into Finisar.SQLite.dll assembly. Version 0.2 (Nov 14, 2003) - Fixed a couple of serious unintialized pointer bugs. Ouch. - Added timing to test.exe. Version 0.1 (Nov 7, 2003) This is the initial release of our ADO.NET Data Provider for SQLite. It has been developed in Visual Studio 2003, using C++ with Managed Extensions. A version of SQLite is included. This is a post 2.8.6 CVS snapshot of the SQLite code base, and is necessary because this ADO.NET provider requires some experimental features that are not part of an "official" SQLite release yet. The code is very early (pre-alpha) in development, and has been tested very little, either for function or coverage. It includes no documentation apart from the source code itself, which is admittedly only sparsely commented. Feedback is encouraged.