mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
Fix links to documentation images
This commit is contained in:
1 parent
8658b7bc10
commit
59f9482aa7
2 files changed
+5
-5
No files matched your search
@@ -321,11 +321,11 @@ Despite the common [guarantees](#safe-and-unsafe-database-accesses) and [rules](
|
||||
|
||||
[DatabaseQueue] opens a single database connection, and serializes all database accesses, reads, and writes. There is never more than one thread that uses the database. In the image below, we see how three threads can see the database as time passes:
|
||||
|
||||

|
||||

|
||||
|
||||
[DatabasePool] manages a pool of several database connections, and allows concurrent reads and writes thanks to the [WAL mode](https://www.sqlite.org/wal.html). A database pool serializes all writes (the [Serialized Writes] guarantee). Reads are isolated so that they don't see changes performed by other threads (the [Isolated Reads] guarantee). This gives a very different picture:
|
||||
|
||||

|
||||

|
||||
|
||||
See how, with database pools, two reads can see different database states at the same time. This may look scary! Please see the next [Concurrent Thinking] chapter below for a relief.
|
||||
|
||||
@@ -345,7 +345,7 @@ All you need is a little "concurrent thinking", based on those two basic facts:
|
||||
|
||||
- Whenever you extract some data from a database access, immediately consider it as _stale_. It is stale, whether you use a database queue or a database pool. It is stale because nothing prevents other application threads or processes from overwriting the value you have just fetched:
|
||||
|
||||
<img align="right" src="https://github.com/groue/GRDB.swift/raw/development/Documentation/Images/TwoCookiesLeft.jpg" width="50%">
|
||||
<img align="right" src="https://github.com/groue/GRDB.swift/raw/master/Documentation/Images/TwoCookiesLeft.jpg" width="50%">
|
||||
|
||||
```swift
|
||||
// or dbQueue.write, for that matter
|
||||
@@ -434,7 +434,7 @@ try dbPool.writeWithoutTransaction { db in
|
||||
|
||||
In the illustration below, the striped band shows the delay needed for the reading thread to acquire isolation. Until then, no other thread can write:
|
||||
|
||||

|
||||

|
||||
|
||||
[Transaction Observers](../README.md#transactionobserver-protocol) can also use those methods in their `databaseDidCommit` method, in order to process database changes without blocking other threads that want to write into the database.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ This document exposes its inner organization, so that you can leverage the most
|
||||
|
||||
In the diagram below, protocols are pale blue and have rounded corners, and standard types are grey rectangles. Solid arrows read "inherits from", and dashed arrows read "produces". Generic types are marked as such, as well as "PATs" (protocols with associated types).
|
||||
|
||||
<img src="https://github.com/groue/GRDB.swift/raw/development/Documentation/Images/QueryInterfaceOrganization2.png" width="100%">
|
||||
<img src="https://github.com/groue/GRDB.swift/raw/master/Documentation/Images/QueryInterfaceOrganization2.png" width="100%">
|
||||
|
||||
Diagram items are described below:
|
||||
|
||||
|
||||
Reference in new issue
Block a user