bgrainger / System.Data.SQLite

A lightweight ADO.NET wrapper around SQLite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is not the official System.Data.SQLite

The official ADO.NET wrapper for SQLite can be found at http://system.data.sqlite.org/.

This is an independent implementation of the core of ADO.NET: IDbConnection, IDbCommand, IDbDataReader, IDbTransaction (plus a few helpers) -- enough types to let you create and query SQLite databases from managed code, including support for libraries such as Dapper.

Build Status

Build status

Why?

There are several problems with the official SQLite wrapper that prompted this replacement:

  1. Not Invented Here 😄
  2. Has performance problems, such as the SQLiteFunction static constructor that scans all loaded assemblies for usages of SQLiteFunctionAttribute.
  3. Has complicated finalizers to work around incorrect use; this library instead just requires that Dispose be called on all IDisposable objects. (These finalizers were in Robert Simpson's version; they may have been removed in later versions.)
  4. Has interesting type conversion behavior.
  5. Introduces breaking changes.
  6. Doesn't support passing a VFS name to sqlite3_open_v2.
  7. Builds platform-specific assemblies, instead of Any CPU ones.
  8. If we maintain our own fork to work around these changes, there are frequent conflicts when merging in new upstream versions.

There are also improvements we can make in a custom wrapper:

Notes

This library is generally compatible with the official System.Data.SQLite API, but a few changes were made where necessary:

This wrapper is managed-only; you still need a copy of the native SQLite library. A recent copy is provided in the lib folder (for the unit tests).

About

A lightweight ADO.NET wrapper around SQLite

License:MIT License


Languages

Language:C# 98.7%Language:PowerShell 1.3%