Changeset 207:05a4873e7cc8

Show
Ignore:
Timestamp:
06/13/06 19:23:36 (2 years ago)
Author:
gh
Tags:
2.3.0
Message:

Documentation for the set_authorizer API.

Location:
doc
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • doc/usage-guide.txt

    r200 r207  
    66| (c) 2005-2006 Gerhard Häring 
    77 
    8 Last updated for pysqlite 2.2.1 
     8Last updated for pysqlite 2.3.0 
    99 
    1010Table Of Contents 
     
    2626|   `3.4 Checking for complete statements`_ 
    2727|   `3.5 Enabling SQLite's shared cache`_ 
     28|   `3.6 Setting an authorizer callback`_ 
    2829| `4. SQLite and Python types`_ 
    2930|   `4.1 Introduction`_ 
     
    670671   :source-file: code/shared_cache.py 
    671672 
     6733.6 Setting an authorizer callback 
     674---------------------------------- 
     675 
     676You can set an authorizer callback if you want to restrict what your users can 
     677do with the database. This is mostly useful if you accept arbitrary SQL from 
     678users and want to execute it safely. See the relevant section in the SQL 
     679documentation for details: 
     680http://sqlite.org/capi3ref.html#sqlite3_set_authorizer 
     681 
     682All necessary constants like SQLITE_OK, SQLITE_DENY, SQLITE_IGNORE, 
     683SQLITE_SELECT, SQLITE_CREATE_INDEX and all other authorizer-related constants 
     684are available through the dbapi2 module. 
     685 
     686Here's an example that demonstrates the usage of this function: 
     687 
     688  .. code-block:: 
     689   :language: Python 
     690   :source-file: code/authorizer.py 
     691 
     692 
    6726934. SQLite and Python types 
    673694==========================