SQLite Licensing File Auth.c

Source: Internet
Author: User
Tags auth

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.