开发者

Are predicate templates the same thing like prepared statements?

开发者 https://www.devze.com 2022-12-19 23:12 出处:网络
For example i开发者_如何学运维f I had this predicate format string, would that have the same security benefits like prepared statements in SQL offer?

For example i开发者_如何学运维f I had this predicate format string, would that have the same security benefits like prepared statements in SQL offer?

@"name == $LAST_NAME"

I am not sure if this is a plain stupid substitution which still allows bad "SQL" injection to core data, or if this is just as good as prepared statements known from modern db technologies?


You are not running on a server and any user is going to get complete access to the sqlite file anyway so there is no security there to subvert.

In addition, this is a predicate and it is not a stored sql statement. When your application runs the predicate, Core Data will do the translation to sql, it does not store that translation.

In short, nothing to fear here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号