Skip to content

Commit 318067a

Browse files
authored
Merge pull request PerfectlySoft#29 from crspybits/master
Added methods: lastInsertId, and numberAffectedRows.
2 parents 13c7378 + 3254776 commit 318067a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/PerfectMySQL/MySQL.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ public final class MySQL {
130130
}
131131
return MySQL.Results(ret)
132132
}
133+
134+
public func lastInsertId() -> Int64 {
135+
return Int64(mysql_insert_id(mysqlPtr))
136+
}
137+
138+
public func numberAffectedRows() -> Int64 {
139+
return Int64(mysql_affected_rows(mysqlPtr))
140+
}
133141

134142
func exposedOptionToMySQLOption(_ o: MySQLOpt) -> mysql_option {
135143
switch o {

0 commit comments

Comments
 (0)