0001    class PrintDriver
Database.swift:3
	public static var driver: Driver = PrintDriver()
: Driver { 0002 0003 func fetchOne(table table: String, filters: [Filter]) -> [String: String]? { 0004 print("Fetch One") 0005 print("\ttable: \(table)") 0006 self.printFilters(filters) 0007 0008 return nil 0009 } 0010 0011 func fetch(table table: String, filters: [Filter]) -> [[String: String]] { 0012 print("Fetch") 0013 print("\ttable: \(table)") 0014 self.printFilters(filters) 0015 0016 return [] 0017 } 0018 0019 func delete(table table: String, filters: [Filter]) { 0020 print("Delete") 0021 print("\ttable: \(table)") 0022 self.printFilters(filters) 0023 } 0024 0025 func update(table table: String, filters: [Filter], data: [String: String]) { 0026 print("Update") 0027 print("\ttable: \(table)") 0028 self.printFilters(filters) 0029 print("\t\(data.count) data points") 0030 for (key, value) in data { 0031 print("\t\t\(key)=\(value)") 0032 } 0033 } 0034 0035 func insert(table table: String, items: [[String: String]]) { 0036 print("Insert") 0037 print("\ttable: \(table)") 0038 print("\t\(items.count) items") 0039 for (key, item) in items.enumerate() { 0040 print("\t\titem \(key)") 0041 for (key, val) in item { 0042 print("\t\t\t\(key)=\(val)") 0043 } 0044 } 0045 } 0046 0047 func upsert(table table: String, items: [[String: String]]) { 0048 print("Upsert") 0049 print("\ttable: \(table)") 0050 print("\t\(items.count) items") 0051 for (key, item) in items.enumerate() { 0052 print("\t\titem \(key)") 0053 for (key, val) in item { 0054 print("\t\t\t\(key)=\(val)") 0055 } 0056 } 0057 0058 } 0059 func exists(table table: String, filters: [Filter]) -> Bool { 0060 print("Exists") 0061 print("\ttable: \(table)") 0062 self.printFilters(filters) 0063 0064 return false 0065 } 0066 0067 func count(table table: String, filters: [Filter]) -> Int { 0068 print("Count") 0069 print("\ttable: \(table)") 0070 self.printFilters(filters) 0071 0072 return 0 0073 } 0074 0075 func printFilters
PrintDriver.swift:6
		self.printFilters(filters)
PrintDriver.swift:14
		self.printFilters(filters)
PrintDriver.swift:22
		self.printFilters(filters)
PrintDriver.swift:28
		self.printFilters(filters)
PrintDriver.swift:62
		self.printFilters(filters)
PrintDriver.swift:70
		self.printFilters(filters)
(filters: [Filter]) { 0076 print("\t\(filters.count) filter(s)") 0077 for filter in filters { 0078 if let filter = filter as? CompareFilter { 0079 let symbol: String 0080 switch filter.comparison { 0081 case .Equals: 0082 symbol = "=" 0083 case .NotEquals: 0084 symbol = "!=" 0085 case .GreaterThan: 0086 symbol = ">" 0087 case .LessThan: 0088 symbol = "<" 0089 case .GreaterThanOrEquals: 0090 symbol = ">=" 0091 case .LessThanOrEquals: 0092 symbol = "<=" 0093 } 0094 0095 print("\t\t\(filter.key) \(symbol) \(filter.value)") 0096 } else if let filter = filter as? SubsetFilter { 0097 let op: String 0098 switch filter.comparison { 0099 case .In: 0100 op = "in" 0101 case .NotIn: 0102 op = "not in" 0103 } 0104 0105 print("\t\t\(filter.key) \(op) \(filter.superSet.count) options") 0106 } 0107 } 0108 } 0109 0110 }