加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

SQLite 授权动作编码(AuthorizerAction Codes)

发布时间:2020-12-12 23:45:29 所属栏目:百科 来源:网络整理
导读:该文章主要与注册授权回调函数相关:sqlite3_set_authorizer 详细的调用方式,请参考其他的章节!! 摘自: https://www.sqlite.org/c3ref/c_alter_table.html /*******************************************3rd ************ 4th ***********/ #define SQLI

该文章主要与注册授权回调函数相关:sqlite3_set_authorizer

详细的调用方式,请参考其他的章节!!

摘自:https://www.sqlite.org/c3ref/c_alter_table.html

/*******************************************3rd ************ 4th ***********/

#define SQLITE_CREATE_INDEX 1/* Index Name Table Name */

#define SQLITE_CREATE_TABLE 2/* Table Name NULL */

#define SQLITE_CREATE_TEMP_INDEX 3/* Index Name Table Name */

#define SQLITE_CREATE_TEMP_TABLE 4/* Table Name NULL */

#define SQLITE_CREATE_TEMP_TRIGGER 5 /*Trigger Name Table Name */

#define SQLITE_CREATE_TEMP_VIEW 6/* View Name NULL */

#define SQLITE_CREATE_TRIGGER 7/* Trigger Name Table Name */

#define SQLITE_CREATE_VIEW 8/* View Name NULL */

#define SQLITE_DELETE 9 /* Table Name NULL */

#define SQLITE_DROP_INDEX 10/* Index Name Table Name */

#define SQLITE_DROP_TABLE 11/* Table Name NULL */

#define SQLITE_DROP_TEMP_INDEX 12/* Index Name Table Name */

#define SQLITE_DROP_TEMP_TABLE 13/* Table Name NULL */

#define SQLITE_DROP_TEMP_TRIGGER 14/* Trigger Name Table Name */

#define SQLITE_DROP_TEMP_VIEW 15/* View Name NULL */

#define SQLITE_DROP_TRIGGER 16/* Trigger Name Table Name */

#define SQLITE_DROP_VIEW 17/* View Name NULL */

#define SQLITE_INSERT 18 /* Table Name NULL */

#define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */

#define SQLITE_READ 20 /* Table Name Column Name */

#define SQLITE_SELECT 21 /* NULL NULL */

#define SQLITE_TRANSACTION 22/* Operation NULL */

#define SQLITE_UPDATE 23 /* Table Name Column Name */

#define SQLITE_ATTACH 24 /* Filename NULL */

#define SQLITE_DETACH 25 /* Database Name NULL */

#define SQLITE_ALTER_TABLE 26/* Database Name Table Name */

#define SQLITE_REINDEX 27 /* Index Name NULL */

#define SQLITE_ANALYZE 28 /* Table Name NULL */

#define SQLITE_CREATE_VTABLE 29/* Table Name ModuleName */

#define SQLITE_DROP_VTABLE 30/* Table Name ModuleName */

#define SQLITE_FUNCTION 31 /* NULL Function Name */

#define SQLITE_SAVEPOINT 32/* Operation SavepointName */

#define SQLITE_COPY 0 /* No longer used */

#define SQLITE_RECURSIVE 33/* NULL NULL */

sqlite3_set_authorizer接口注册一个回调函数,该回调函数将被调用去授权执行SQL语句。回调函数的第二个参数是一个整型,指定了那些操作是被授权的,这些整型的动作编码(integer action codes)是回调函数可以通过的。

这些动作编号值指定了哪种操作是被允许的。第三和第四个参数是否为NULL,还是其他的参数,完全依赖于第二个参数的设置,第五个参数是数据库的名称(main,temp,或者其他)if applicable.第六个参数尝试访问的内置触发器或者视图,当然如果为NULL,表示尝试访问来自于最高级的SQL编码(The 6th parameter to the authorizer callback is the nameof the inner-most trigger or view that is responsible for the access attempt orNULL if this access attempt is directly from top-level SQL code.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读