README.md: even though "column == true" condition is supported, we don't have to foster it.

This commit is contained in:
Gwendal Roué committed 2016-03-30 09:58:58 +02:00
1 parent 83ec50e4ab
commit abbf0cd856
1 file changed
+3 -3
+3 -3
View File
@@ -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.**