Skip to content

Commit d9751a7

Browse files
committed
2 parents 4bc42e3 + 650cb88 commit d9751a7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ using (var stream = new MemoryStream(Encoding.UTF8.GetBytes("I'm a byte stream")
105105
}
106106
```
107107

108+
Note: Be conservative when using the Async API. SQLite has an inherently synchronous blocking API. A single thread pool thread is scheduled and used per asynchronous request, and a thread hop is required to return control to the UI thread when using Async/Await. Fine grain async requests can therefore result in a significant number of thread hops resulting in unnecessary additional latency. In general, it is best practice to schedule a logical sql block into a single call to IAsyncDatabase.Use() that either returns a value or an IEnumerable of values. If the IEnumerable of values is lazily evaluated, this can also result in better UI responsiveness, as the UI can process items as they are enumerated.
109+
108110
# But I absolutely must have an ORM
109111

110112
SQLitePCL.pretty has a very simple table mapping ORM, available in the SQLitePCL.pretty.Orm package on nuget. It supports inserting both new and existing objects, and finding and deleting objects by primary key, from SQLite database tables. Notably, the ORM is designed to make working with immutable data types much easier by supporting the builder pattern for deserializing database objects. Below is a simplish example:

0 commit comments

Comments
 (0)