开发者

Qt Sqlite user access

I'm working with sqlite and qt. I understand that sqlite doesn't have native user access control and am fine with that, and have a plan for controlling access using my application - set up some user groups in a db and authenticate on the app side.

What I would like to know is if there is an easy way to stop my views on QSqlRelationalTableModel data from updating the database (i.e make the database readonly).

I am currently using an editstrategy of OnFieldChange, if I change it to OnManualSubmit for examp开发者_如何学Gole (without implementing a submit call), will that prevent updates to the dB?

Is there a cleverer way of doing this? Like making the view readonly?


If you create views, then they will be read-only since sqlite doesn't support updating views: http://www.sqlite.org/lang_createview.html

EDIT

Following-up on your comment, is the QSQLITE_OPEN_READONLY connection setting what you are looking for? http://doc.trolltech.com/4.6/qsqldatabase.html#setConnectOptions

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜