如何基于特定过滤器从Swift中的SWLIte DB获取记录?

时间:2019-02-10 01:06:55

标签: sqlite

func loadData() { 
   do {  
       let records = try self.empDB.prepare(self.empTable).filter(ID == 20)                 
       for record in records {      
           empId = record[self.ID]      
           empName = record[self.Name]      
           empAddress = record[self.Address] 
       }
   } catch {  
       print("No record found")    
   } 
} 

0 个答案:

没有答案