@@ -444,14 +444,14 @@ public struct Query {
444444 /// :param: values A list of values to set.
445445 ///
446446 /// :returns: The rowid.
447- public func insert( value: Setter , _ more: Setter ... ) -> Int64 ? { return insert ( [ value] + more) . id }
447+ public func insert( value: Setter , _ more: Setter ... ) -> Int64 ? { return insert ( [ value] + more) . rowid }
448448
449449 /// Runs an INSERT statement against the query.
450450 ///
451451 /// :param: values A list of values to set.
452452 ///
453453 /// :returns: The rowid and statement.
454- public func insert( value: Setter , _ more: Setter ... ) -> ( id : Int64 ? , statement: Statement ) {
454+ public func insert( value: Setter , _ more: Setter ... ) -> ( rowid : Int64 ? , statement: Statement ) {
455455 return insert ( [ value] + more)
456456 }
457457
@@ -460,16 +460,16 @@ public struct Query {
460460 /// :param: values An array of values to set.
461461 ///
462462 /// :returns: The rowid.
463- public func insert( values: [ Setter ] ) -> Int64 ? { return insert ( values) . id }
463+ public func insert( values: [ Setter ] ) -> Int64 ? { return insert ( values) . rowid }
464464
465465 /// Runs an INSERT statement against the query.
466466 ///
467467 /// :param: values An array of values to set.
468468 ///
469469 /// :returns: The rowid and statement.
470- public func insert( values: [ Setter ] ) -> ( id : Int64 ? , statement: Statement ) {
470+ public func insert( values: [ Setter ] ) -> ( rowid : Int64 ? , statement: Statement ) {
471471 let statement = insertStatement ( values) . run ( )
472- return ( statement. failed ? nil : database. lastId , statement)
472+ return ( statement. failed ? nil : database. lastInsertRowid , statement)
473473 }
474474
475475 public func insert( query: Query ) -> Int ? { return insert ( query) . changes }
@@ -479,16 +479,16 @@ public struct Query {
479479 public func insert( query: Query ) -> ( changes: Int ? , statement: Statement ) {
480480 let expression = query. selectExpression
481481 let statement = database. run ( " INSERT INTO \( tableName. unaliased. SQL) \( expression. SQL) " , expression. bindings)
482- return ( statement. failed ? nil : database. lastChanges , statement)
482+ return ( statement. failed ? nil : database. changes , statement)
483483 }
484484
485- public func insert( ) -> Int64 ? { return insert ( ) . id }
485+ public func insert( ) -> Int64 ? { return insert ( ) . rowid }
486486
487487 public func insert( ) -> Statement { return insert ( ) . statement }
488488
489- public func insert( ) -> ( id : Int64 ? , statement: Statement ) {
489+ public func insert( ) -> ( rowid : Int64 ? , statement: Statement ) {
490490 let statement = database. run ( " INSERT INTO \( tableName. unaliased. SQL) DEFAULT VALUES " )
491- return ( statement. failed ? nil : database. lastId , statement)
491+ return ( statement. failed ? nil : database. lastInsertRowid , statement)
492492 }
493493
494494 /// Runs a REPLACE statement against the query.
@@ -503,14 +503,14 @@ public struct Query {
503503 /// :param: values A list of values to set.
504504 ///
505505 /// :returns: The rowid.
506- public func replace( values: Setter ... ) -> Int64 ? { return replace ( values) . id }
506+ public func replace( values: Setter ... ) -> Int64 ? { return replace ( values) . rowid }
507507
508508 /// Runs a REPLACE statement against the query.
509509 ///
510510 /// :param: values A list of values to set.
511511 ///
512512 /// :returns: The rowid and statement.
513- public func replace( values: Setter ... ) -> ( id : Int64 ? , statement: Statement ) {
513+ public func replace( values: Setter ... ) -> ( rowid : Int64 ? , statement: Statement ) {
514514 return replace ( values)
515515 }
516516
@@ -519,16 +519,16 @@ public struct Query {
519519 /// :param: values An array of values to set.
520520 ///
521521 /// :returns: The rowid.
522- public func replace( values: [ Setter ] ) -> Int64 ? { return replace ( values) . id }
522+ public func replace( values: [ Setter ] ) -> Int64 ? { return replace ( values) . rowid }
523523
524524 /// Runs a REPLACE statement against the query.
525525 ///
526526 /// :param: values An array of values to set.
527527 ///
528528 /// :returns: The rowid and statement.
529- public func replace( values: [ Setter ] ) -> ( id : Int64 ? , statement: Statement ) {
529+ public func replace( values: [ Setter ] ) -> ( rowid : Int64 ? , statement: Statement ) {
530530 let statement = insertStatement ( values, or: . Replace) . run ( )
531- return ( statement. failed ? nil : database. lastId , statement)
531+ return ( statement. failed ? nil : database. lastInsertRowid , statement)
532532 }
533533
534534 /// Runs an UPDATE statement against the query.
@@ -568,7 +568,7 @@ public struct Query {
568568 /// :returns: The number of updated rows and statement.
569569 public func update( values: [ Setter ] ) -> ( changes: Int ? , statement: Statement ) {
570570 let statement = updateStatement ( values) . run ( )
571- return ( statement. failed ? nil : database. lastChanges , statement)
571+ return ( statement. failed ? nil : database. changes , statement)
572572 }
573573
574574 /// Runs a DELETE statement against the query.
@@ -586,7 +586,7 @@ public struct Query {
586586 /// :returns: The number of deleted rows and statement.
587587 public func delete( ) -> ( changes: Int ? , statement: Statement ) {
588588 let statement = deleteStatement. run ( )
589- return ( statement. failed ? nil : database. lastChanges , statement)
589+ return ( statement. failed ? nil : database. changes , statement)
590590 }
591591
592592 // MARK: - Aggregate Functions
0 commit comments