From e36ca9f64594b1065fe1469cf8a7f95fb43691d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 21 Feb 2019 23:20:03 +0100 Subject: [PATCH] Foster SQL interpolation --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8af33e2ae..8350b6969 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,12 @@ try dbQueue.write { db in """, arguments: ["Paris", true, 48.85341, 2.3488]) let parisId = db.lastInsertedRowID + + // Swift 5 only + try db.execute(literal: """ + INSERT INTO place (title, favorite, latitude, longitude) + VALUES (\("Madrid"), \(true), \(40.41678), \(-3.70379)) + """) } ``` @@ -264,7 +270,7 @@ Documentation #### SQLite and SQL -- [SQLite API](#sqlite-api): The low-level SQLite API • [executing updates](#executing-updates) • [fetch queries](#fetch-queries) +- [SQLite API](#sqlite-api): The low-level SQLite API • [executing updates](#executing-updates) • [fetch queries](#fetch-queries) • [SQL Interpolation] #### Records and the Query Interface @@ -572,6 +578,7 @@ SQLite API - [Swift enums](#swift-enums) - [Custom Value Types](#custom-value-types) - [Transactions and Savepoints](#transactions-and-savepoints) +- [SQL Interpolation] Advanced topics: @@ -8657,4 +8664,4 @@ This chapter has been renamed [Beyond FetchableRecord]. [DatabaseRegionConvertible]: #the-databaseregionconvertible-protocol [ValueObservation and DatabaseRegionObservation]: #valueobservation-and-databaseregionobservation [DatabaseRegion]: #databaseregion -[SQL Interpolation]: (Documentation/SQLInterpolation.md) +[SQL Interpolation]: Documentation/SQLInterpolation.md