mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
DESIGN.md
This commit is contained in:
1 parent
51293bfce2
commit
fa15cfb30f
1 file changed
+6
-2
@@ -1,8 +1,7 @@
|
||||
The Design of GRDB.swift
|
||||
========================
|
||||
|
||||
More than caveats or defects, there are a few glitches, or surprises in the GRDB.swift API. We try to explain them here. And eventually, explanations may lead to solutions :-)
|
||||
|
||||
More than caveats or defects, there are a few glitches, or surprises in the GRDB.swift API. We try to explain them here. The interested readers can take them as Swift challenges!
|
||||
|
||||
- **Why is RowModel a class, when protocols are all the rage?**
|
||||
|
||||
@@ -36,6 +35,11 @@ More than caveats or defects, there are a few glitches, or surprises in the GRDB
|
||||
}
|
||||
```
|
||||
|
||||
A second reason: the `databaseEdited` flag, which is true when a RowModel has unsaved changes, is easily provided by the base class RowModel. RowModel can manage its internal state *accross method calls*. Protocols could not provide this service without extra complexity.
|
||||
|
||||
Yet, don't miss the [RowConvertible](http://cocoadocs.org/docsets/GRDB.swift/0.12.0/Protocols/RowConvertible.html) and [DatabaseMapping](http://cocoadocs.org/docsets/GRDB.swift/0.12.0/Protocols/DatabaseTableMapping.html) protocols: they provide fetching from custom SQL queries and fetching by primary key for free.
|
||||
|
||||
|
||||
- **Why are DatabaseQueue.inTransaction() and DatabaseQueue.inDatabase() not reentrant?**
|
||||
|
||||
TODO
|
||||
|
||||
Reference in new issue
Block a user