Code Anatomy
The file contains the code that implements the Sliqte3_set_authorizer function. For The SQLite library, this feature
is optional. Embedded systems do not require this functionality and can be-dsqlite_omit_authorization=1 by precompiled macros
to disable this option. In fact, in the pre-compilation options for VS, add sqlite_omit_authorization !!
If you define a Sqlite_omit_authorization macro, all code for the file is ignored
The following is a description of the two heavyweight functions:
int Sqlite3_set_authorizer
(
Sqlite3 *db,
Int (*xauth) (void*,int,const char*,const char*,const char*,const char*),
void *parg
)
Set or clear the Access authorization function
The Sqlite3_set_authorizer function passes a pointer to the authorization function that is registered in to the
The handle structure of the database is sqlite3*db, and the third parameter of the function is also saved to the handle
Don't take it for granted, a handle is a pointer to a struct.
Actually here's a question to consider: how to prevent deadlocks, a lock on her maximum range
How to control, where the real locking is needed!!
Learn how to use C Language, realization of object-oriented programming idea, how to organize the function of the processing structure
The third and fourth parameters are the table and column names that are currently being accessed, and the authentication function can only return Sqlite_ok,sqlite_deny
Sqlite_ignore. If you return SQLITE_OK, which indicates that access operations are allowed to execute. Sqlite_deny means that SQL statements are not
Line,the sqlite3_exec function will return an error message,sqlite_ignore means that the SQL statement will be parsed, but the attempt to read
Fetch, will return an empty collection, attempt to write will be ignored!!
int Sqlite3authcheck
(
Parse *pparse,
Intcode,
const Char *ZARG1,
const Char *ZARG2,
const CHAR *ZARG3
)
SQLite Licensing File Auth.c