Documentation

This commit is contained in:
Gwendal Roué committed 2019-02-17 13:24:37 +01:00
1 parent 9b6c9b421a
commit ff439c2dbc
7 files changed
+38 -23

No files matched your search

+2 -5
View File
@@ -205,11 +205,8 @@ extension Database {
/// INSERT INTO player (name) VALUES (?);
/// """, arguments: ["Arthur", "Barbara", "O'Brien"]))
///
/// With Swift 5, you can profit from string interpolation:
///
/// try db.execute(SQLString("""
/// INSERT INTO player (name) VALUES (\("Arthur"))
/// """))
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// try db.execute(SQLString("""
/// INSERT INTO player (name) VALUES (\("Arthur"));
+10 -5
View File
@@ -315,7 +315,8 @@ extension DatabaseValueConvertible {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try String.fetchCursor(db, SQLString("""
/// SELECT firstName FROM player
@@ -347,7 +348,8 @@ extension DatabaseValueConvertible {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try String.fetchAll(db, SQLString("""
/// SELECT firstName FROM player
@@ -374,7 +376,8 @@ extension DatabaseValueConvertible {
/// WHERE lastName = ?
/// """, arguments: ["O'Brien"])) // String?
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstName = try String.fetchOne(db, SQLString("""
/// SELECT firstName FROM player
@@ -620,7 +623,8 @@ extension Optional where Wrapped: DatabaseValueConvertible {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try Optional<String>.fetchCursor(db, SQLString("""
/// SELECT firstName FROM player
@@ -652,7 +656,8 @@ extension Optional where Wrapped: DatabaseValueConvertible {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try Optional<String>.fetchAll(db, SQLString("""
/// SELECT firstName FROM player
+6 -3
View File
@@ -812,7 +812,8 @@ extension Row {
/// let lastName: String = row["lastName"]
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let rows = try Row.fetchCursor(db, SQLString("""
/// SELECT * FROM player WHERE lastName = \("O'Brien")
@@ -852,7 +853,8 @@ extension Row {
/// let lastName: String = row["lastName"]
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let rows = try Row.fetchAll(db, SQLString("""
/// SELECT * FROM player WHERE lastName = \("O'Brien")
@@ -879,7 +881,8 @@ extension Row {
/// let lastName: String = row["lastName"]
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let row = try Row.fetchOne(db, SQLString("""
/// SELECT * FROM player WHERE lastName = \("O'Brien")
+2 -1
View File
@@ -39,7 +39,8 @@ public struct SQLRequest<T> : FetchRequest {
/// SELECT * FROM player WHERE name = ?
/// """, arguments: ["O'Brien"]))
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let request = SQLRequest<Player>(SQLString("""
/// SELECT * FROM player WHERE name = \("O'brien")
+10 -5
View File
@@ -300,7 +300,8 @@ extension DatabaseValueConvertible where Self: StatementColumnConvertible {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try String.fetchCursor(db, SQLString("""
/// SELECT firstName FROM player
@@ -332,7 +333,8 @@ extension DatabaseValueConvertible where Self: StatementColumnConvertible {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try String.fetchAll(db, SQLString("""
/// SELECT firstName FROM player
@@ -359,7 +361,8 @@ extension DatabaseValueConvertible where Self: StatementColumnConvertible {
/// WHERE lastName = ?
/// """, arguments: ["O'Brien"])) // String?
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstName = try String.fetchOne(db, SQLString("""
/// SELECT firstName FROM player
@@ -601,7 +604,8 @@ extension Optional where Wrapped: DatabaseValueConvertible & StatementColumnConv
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try Optional<String>.fetchCursor(db, SQLString("""
/// SELECT firstName FROM player
@@ -633,7 +637,8 @@ extension Optional where Wrapped: DatabaseValueConvertible & StatementColumnConv
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let firstNames = try Optional<String>.fetchAll(db, SQLString("""
/// SELECT firstName FROM player
+6 -3
View File
@@ -270,7 +270,8 @@ extension FetchableRecord {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let players = try Player.fetchCursor(db, SQLString("""
/// SELECT * FROM player WHERE lastName = \("O'Brien")
@@ -300,7 +301,8 @@ extension FetchableRecord {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let players = try Player.fetchAll(db, SQLString("""
/// SELECT * FROM player WHERE lastName = \("O'Brien")
@@ -325,7 +327,8 @@ extension FetchableRecord {
/// ...
/// }
///
/// With Swift 5, you can profit from string interpolation:
/// With Swift 5, you can safely embed raw values in your SQL queries,
/// without any risk of syntax errors or SQL injection:
///
/// let player = try Player.fetchOne(db, SQLString("""
/// SELECT * FROM player WHERE lastName = \("O'Brien")
@@ -361,7 +361,8 @@ try dbQueue.read { db in
//: """, arguments: ["O'Brien"]) // [Base]
//: }
//:
//: With Swift 5, you can profit from string interpolation:
//: With Swift 5, you can safely embed raw values in your SQL queries,
//: without any risk of syntax errors or SQL injection:
//:
//: try dbQueue.read { db in
//: try Base.fetchAll(db, SQLString("""