|
1 | 1 |
|
2 | | -Overview |
3 | | -=== |
| 2 | +# sqlite-net |
4 | 3 |
|
5 | | -sqlite-net is an open source, minimal library to allow .NET and Mono applications to store data in [http://www.sqlite.org SQLite 3 databases]. It is written in C# 3.0 and is meant to be simply compiled in with your projects. It was first designed to work with [http://monotouch.net/ MonoTouch] on the iPhone, but should work in any other CLI environment. |
| 4 | +sqlite-net is an open source, minimal library to allow .NET and Mono applications to store data in [http://www.sqlite.org SQLite 3 databases]. It is written in C# and is meant to be simply compiled in with your projects. It was first designed to work with [MonoTouch](http://xamarin.com) on the iPhone, but has grown up to work on all the platforms (Mono for Android, .NET, Silverlight, WP7, WinRT, Azure, etc.). |
6 | 5 |
|
7 | 6 | sqlite-net was designed as a quick and convenient database layer. Its design follows from these *goals*: |
8 | 7 |
|
9 | | -* It should be very easy to integrate with existing projects and with MonoTouch projects. |
| 8 | +* Very easy to integrate with existing projects and with MonoTouch projects. |
10 | 9 |
|
11 | | -* It is a thin wrapper over SQLite and should be fast and efficient. (The library should not be the performance bottleneck of your queries.) |
| 10 | +* Thin wrapper over SQLite and should be fast and efficient. (The library should not be the performance bottleneck of your queries.) |
12 | 11 |
|
13 | | -* It provides very simple methods for executing queries safely (using parameters) and for retrieving the results of those query in a strongly typed fashion. |
| 12 | +* Very simple methods for executing CRUD operations and queries safely (using parameters) and for retrieving the results of those query in a strongly typed fashion. |
14 | 13 |
|
15 | | -* It works with your data model without forcing you to change your classes. (Contains a small reflection-driven ORM layer.) |
| 14 | +* Works with your data model without forcing you to change your classes. (Contains a small reflection-driven ORM layer.) |
16 | 15 |
|
17 | | -* It has 0 dependencies aside from a [http://www.sqlite.org/download.html compiled form of the sqlite3 library]. |
| 16 | +* 0 dependencies aside from a [compiled form of the sqlite2 library](http://www.sqlite.org/download.html). |
18 | 17 |
|
19 | 18 | *Non-goals* include: |
20 | 19 |
|
21 | | -* No `IQueryable` support for constructing queries. You can of course use LINQ on the results of queries, but you cannot use it to construct the queries. |
22 | | - |
23 | | -* Not an implementation of `IDbConnection` and its family. This is not a full SQLite driver. If you need that, go get [http://sqlite.phxsoftware.com/ System.Data.SQLite] or [http://code.google.com/p/csharp-sqlite/ csharp-sqlite]. |
| 20 | +* Not an ADO.NET implementation. This is not a full SQLite driver. If you need that, use [Mono.Data.SQLite](http://www.mono-project.com/SQLite) or [csharp-sqlite](http://code.google.com/p/csharp-sqlite/). |
| 21 | + |
| 22 | + |
| 23 | +## Meta |
| 24 | + |
| 25 | +This is an open source project that welcomes contributions/suggestions/bug reports from those who use it. If you have any ideas on how to improve the library, please [post an issue here on github](https://github.com/praeclarum/sqlite-net/issues). Please check out the [How to Contribute](https://github.com/praeclarum/sqlite-net/wiki/How-to-Contribute). |
| 26 | + |
24 | 27 |
|
25 | | -The design is similar to that used by Demis Bellot in the [http://code.google.com/p/servicestack/source/browse/#svn/trunk/Common/ServiceStack.Common/ServiceStack.OrmLite OrmLite sub project of ServiceStack]. |
| 28 | +# Example Time! |
26 | 29 |
|
27 | | -Documentation |
28 | | -=== |
| 30 | +Please consult the Wiki for, ahem, [complete documentation](https://github.com/praeclarum/sqlite-net/wiki). |
29 | 31 |
|
30 | 32 | The library contains simple attributes that you can use to control the construction of tables. In a simple stock program, you might use: |
31 | 33 |
|
@@ -53,8 +55,8 @@ API for mobile applications in order to increase reponsiveness. |
53 | 55 |
|
54 | 56 | Both APIs are explained in the two sections below. |
55 | 57 |
|
56 | | -Synchronous API |
57 | | ---- |
| 58 | +## Synchronous API |
| 59 | + |
58 | 60 | Once you have defined your entity, you can automatically generate tables in your database by calling `CreateTable`: |
59 | 61 |
|
60 | 62 | var db = new SQLiteConnection("foofoo"); |
@@ -100,8 +102,8 @@ The generic parameter to the `Query` method specifies the type of object to crea |
100 | 102 |
|
101 | 103 | You can perform low-level updates of the database using the `Execute` method. |
102 | 104 |
|
103 | | -Asynchronous API |
104 | | ---- |
| 105 | +## Asynchronous API |
| 106 | + |
105 | 107 | The asynchronous library uses the Task Parallel Library (TPL). As such, normal use of `Task` objects, and the `async` and `await` keywords |
106 | 108 | will work for you. |
107 | 109 |
|
@@ -153,21 +155,18 @@ Another helpful method is `ExecuteScalarAsync`. This allows you to return a scal |
153 | 155 | }); |
154 | 156 |
|
155 | 157 |
|
156 | | -Special note on use within Metro-style |
157 | | -=== |
158 | | -sqlite-net is fully compliant with Metro-style. This library will pass Microsoft Store validation. |
| 158 | +## Special note on use within WinRT/Windows 8/Metro Style/whatevr |
159 | 159 |
|
160 | | -Users should note: |
| 160 | +sqlite-net is fully compliant with WinRT Metro-style apps and will pass Microsoft Store validation. |
| 161 | + |
| 162 | +Please note: |
161 | 163 |
|
162 | 164 | * Database files will always be created in the path returned by `Windows.Storage.ApplicationData.Current.LocalFolder.Path`. |
163 | 165 |
|
164 | 166 | * You will need a copy of sqlite3.dll that has been compiled against SQLite.org's WinRT branch. Although this isn't in mainstream |
165 | 167 | support, it is expected to be. You can find more information on that and download a properly compiled sqlite3.dll from |
166 | 168 | [https://github.com/mbrit/sqlite-metrostyle]. |
167 | 169 |
|
168 | | -Meta |
169 | | -=== |
170 | | - |
171 | | -This is an open source project that welcomes contributions/suggestions/bug reports from those who use it. If you have any ideas on how to improve the library, please contact [mailto:fak@praeclarum.org Frank Krueger]. |
| 170 | +* We supply a [WinRT/Windows 8 sqlite3.dll](https://github.com/praeclarum/sqlite-net/tree/master/lib/metro) |
172 | 171 |
|
173 | 172 |
|
0 commit comments