 
 }
 
+private extension FMResultSet {
+
+	func optionalIntForColumn(_ columnName: String) -> Int? {
+		let intValue = long(forColumn: columnName)
+		if intValue < 1 {
+			return nil
+		}
+		return intValue
+	}
+}
+
 extension Set where Element == Attachment {
 
 	func databaseDictionaries() -> [DatabaseDictionary] {
-
 		return self.compactMap { $0.databaseDictionary() }
 	}
 
 	func databaseObjects() -> [DatabaseObject] {
-
 		return self.compactMap { $0 as DatabaseObject }
 	}
 }

//
//  Attachment+Database.swift
//  Database
//
//  Created by Brent Simmons on 7/4/17.
//  Copyright © 2017 Ranchero Software. All rights reserved.

		let attachments = parsedAttachments.compactMap{ Attachment(parsedAttachment: $0) }
		return attachments.isEmpty ? nil : Set(attachments)
	}
}


extension Attachment: DatabaseObject {
	
