in my Xcode Project, I use SQLite to save user order list
My question is if my data like this

Is there any way like table.count and I can get how many row it is ?
Here's my insert method I hope it can be like this
just create a model, and use directly
func insert(_ tableName :String, rowInfo :[String:String]) -> Bool {
var statement :OpaquePointer? = nil
let sql = "insert into \(tableName) "
+ "(\(rowInfo.keys.joined(separator: ","))) "
+ "values (\(rowInfo.values.joined(separator: ",")))"
if sqlite3_prepare_v2(self.db, sql.cString(using: String.Encoding.utf8), -1, &statement, nil) == SQLITE_OK {
if sqlite3_step(statement) == SQLITE_DONE {
return true
}
sqlite3_finalize(statement)
}
return false
}