@@ -140,9 +140,9 @@ public final class Connection {
140140 /// - bindings: A list of parameters to bind to the statement.
141141 ///
142142 /// - Returns: A prepared statement.
143- @warn_unused_result public func prepare( statement: String , _ bindings: Binding ? ... ) -> Statement {
144- if !bindings. isEmpty { return prepare ( statement, bindings) }
145- return Statement ( self , statement)
143+ @warn_unused_result public func prepare( statement: String , _ bindings: Binding ? ... ) throws -> Statement {
144+ if !bindings. isEmpty { return try prepare ( statement, bindings) }
145+ return try Statement ( self , statement)
146146 }
147147
148148 /// Prepares a single SQL statement and binds parameters to it.
@@ -154,8 +154,8 @@ public final class Connection {
154154 /// - bindings: A list of parameters to bind to the statement.
155155 ///
156156 /// - Returns: A prepared statement.
157- @warn_unused_result public func prepare( statement: String , _ bindings: [ Binding ? ] ) -> Statement {
158- return prepare ( statement) . bind ( bindings)
157+ @warn_unused_result public func prepare( statement: String , _ bindings: [ Binding ? ] ) throws -> Statement {
158+ return try prepare ( statement) . bind ( bindings)
159159 }
160160
161161 /// Prepares a single SQL statement and binds parameters to it.
@@ -167,8 +167,8 @@ public final class Connection {
167167 /// - bindings: A dictionary of named parameters to bind to the statement.
168168 ///
169169 /// - Returns: A prepared statement.
170- @warn_unused_result public func prepare( statement: String , _ bindings: [ String : Binding ? ] ) -> Statement {
171- return prepare ( statement) . bind ( bindings)
170+ @warn_unused_result public func prepare( statement: String , _ bindings: [ String : Binding ? ] ) throws -> Statement {
171+ return try prepare ( statement) . bind ( bindings)
172172 }
173173
174174 // MARK: - Run
@@ -245,7 +245,7 @@ public final class Connection {
245245 ///
246246 /// - Returns: The first value of the first row returned.
247247 @warn_unused_result public func scalar( statement: String , _ bindings: [ Binding ? ] ) -> Binding ? {
248- return prepare ( statement) . scalar ( bindings)
248+ return try ! prepare ( statement) . scalar ( bindings)
249249 }
250250
251251 /// Runs a single SQL statement (with optional parameter bindings),
@@ -259,7 +259,7 @@ public final class Connection {
259259 ///
260260 /// - Returns: The first value of the first row returned.
261261 @warn_unused_result public func scalar( statement: String , _ bindings: [ String : Binding ? ] ) -> Binding ? {
262- return prepare ( statement) . scalar ( bindings)
262+ return try ! prepare ( statement) . scalar ( bindings)
263263 }
264264
265265 // MARK: - Transactions
0 commit comments