TableMapping.deleteAll(db)

This commit is contained in:
Gwendal Roué committed 2016-09-17 12:50:57 +02:00
1 parent 7e55a8558a
commit 365e44e376
3 files changed
+51

No files matched your search

@@ -319,6 +319,21 @@ extension TableMapping {
}
extension TableMapping {
// MARK: Deleting
/// Deletes all records; returns the number of deleted rows.
///
/// - parameter db: A database connection.
/// - returns: The number of deleted rows
/// - throws: A DatabaseError is thrown whenever an SQLite error occurs.
@discardableResult public static func deleteAll(_ db: Database) throws -> Int {
return try all().deleteAll(db)
}
}
extension RowConvertible where Self: TableMapping {
// MARK: Fetching All