mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-24 04:07:47 +00:00
TableMapping.deleteAll(db)
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user