SQLite query restrictions

后端 未结 3 1182
太阳男子
太阳男子 2021-01-22 15:06

I am building a little interface where I would like users to be able to write out their entire sql statement and then see the data that is returned. However, I

3条回答
  •  鱼传尺愫
    2021-01-22 15:38

    1. Open the database as read only, to prevent any changes.
    2. Many statements, such as PRAGMA or ATTACH, can be dangerous. Use an authorizer callback (C docs) to allow only SELECTs.
    3. Queries can run for a long time, or generate a large amount of data. Use a progress handler to abort queries that run for too long.

提交回复
热议问题