mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-28 04:24:20 +00:00
README.md: even though "column == true" condition is supported, we don't have to foster it.
This commit is contained in:
1 parent
83ec50e4ab
commit
abbf0cd856
1 file changed
+3
-3
@@ -97,7 +97,7 @@ let favorite = SQLColumn("favorite")
|
||||
let paris = PointOfInterest.fetchOne(dbQueue, key: 1) // PointOfInterest?
|
||||
let berlin = PointOfInterest.filter(title == "Berlin").fetchOne(dbQueue) // PointOfInterest?
|
||||
let favoritePois = PointOfInterest // [PointOfInterest]
|
||||
.filter(favorite == true)
|
||||
.filter(favorite)
|
||||
.order(title)
|
||||
.fetchAll(dbQueue)
|
||||
```
|
||||
@@ -2028,7 +2028,7 @@ Feed [requests](#requests) with SQL expressions built from your Swift code:
|
||||
```swift
|
||||
// SELECT * FROM "events"
|
||||
// WHERE ("userId" IN (SELECT "id" FROM "persons" WHERE "verified"))
|
||||
let verifiedUsers = User.filter(Col.verified == true)
|
||||
let verifiedUsers = User.filter(Col.verified)
|
||||
Event.filter(verifiedUsers.select(Col.id).contains(Col.userId))
|
||||
```
|
||||
|
||||
@@ -2803,7 +2803,7 @@ That being said, unprotected access can do everything (but iterate the memory-ef
|
||||
try dbQueue.execute("INSERT ...")
|
||||
let rows = Row.fetchAll(dbQueue, "SELECT ...")
|
||||
try PointOfInterest(...).insert(dbQueue)
|
||||
let pois = PointOfInterest.filter(favorite == true).order(title).fetchAll(dbQueue)
|
||||
let pois = PointOfInterest.filter(favorite).order(title).fetchAll(dbQueue)
|
||||
```
|
||||
|
||||
**Rule 2: Group your related statements with the safe `inDatabase`, `inTransaction`, `read`, `write` and `writeInTransaction` methods, unless you know what you are doing.**
|
||||
|
||||
Reference in new issue
Block a user