字符串插值与sqlite中的绑定。哪一个更好?

时间:2017-09-26 13:19:54

标签: ios swift sqlite

在sqlite中字符串插值和绑定之间是否有任何区别。 哪一个会表现更好

let firstName = "Aashish"
"Select * from employee where firstName = \(firstName)"

"Select * from employee where firstName = ?"
sqlite3_bind_text(statement,1,firstName.cString(.utf8),-1,SQLITE_TRANSIENT) 

0 个答案:

没有答案