Name
sqlite3_set_authorizer() — Register an authorization callback
Definition
int sqlite3_set_authorizer( sqlite3* db, auth_callback, void* udp );
int auth_callback( void* udp, int action_code,
const char* param1, const char* param2,
const char* db_name, const char* trigger_name );-
db A database connection.
-
auth_callback An application-defined authorization callback function.
-
udp An application-defined user-data pointer. This value is made available to the authorization callback.
-
action_code A code indicating which database operation requires authorization.
param1,param2Two data values related to the authorization action. The specific meaning of these parameters depends on the value of the
action_codeparameter.-
db_name The logical name of the database being affected by the action in question. This value is valid for many, but not all,
action_codevalues.-
trigger_name If the action in question comes from a trigger, the name of the lowest-level trigger. If the action comes from a bare SQL statement, this parameter will be NULL.
- Returns (
sqlite3_set_authorizer()) An SQLite result code.
- Returns (
auth_func()) An SQLite result code. The code
SQLITE_OKindicates that the action is allowed. The codeSQLITE_IGNOREdenies the specific action, but allows the SQL statement to continue. The codeSQLITE_DENYcauses the whole SQL statement to be rejected.
Description
This function registers an authorization callback. The callback is called when SQL statements are prepared, allowing the application to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access