xref: /netbsd-src/external/public-domain/sqlite/man/SQLITE_DBCONFIG_LOOKASIDE.3 (revision c8eabc74fc1f4f2ce329bfb7ee056b844c147190)
1.Dd December 18, 2016
2.Dt SQLITE_DBCONFIG_LOOKASIDE 3
3.Os
4.Sh NAME
5.Nm SQLITE_DBCONFIG_LOOKASIDE ,
6.Nm SQLITE_DBCONFIG_ENABLE_FKEY ,
7.Nm SQLITE_DBCONFIG_ENABLE_TRIGGER ,
8.Nm SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER ,
9.Nm SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
10.Nd Database Connection Configuration Options
11.Sh SYNOPSIS
12.Fd #define SQLITE_DBCONFIG_LOOKASIDE
13.Fd #define SQLITE_DBCONFIG_ENABLE_FKEY
14.Fd #define SQLITE_DBCONFIG_ENABLE_TRIGGER
15.Fd #define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
16.Fd #define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
17.Sh DESCRIPTION
18These constants are the available integer configuration options that
19can be passed as the second argument to the sqlite3_db_config()
20interface.
21.Pp
22New configuration options may be added in future releases of SQLite.
23Existing configuration options might be discontinued.
24Applications should check the return code from sqlite3_db_config()
25to make sure that the call worked.
26The sqlite3_db_config() interface will return a
27non-zero error code if a discontinued or unsupported configuration
28option is invoked.
29.Bl -tag -width Ds
30.It SQLITE_DBCONFIG_LOOKASIDE
31This option takes three additional arguments that determine the lookaside memory allocator
32configuration for the database connection.
33The first argument (the third parameter to sqlite3_db_config()
34is a pointer to a memory buffer to use for lookaside memory.
35The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb may be
36NULL in which case SQLite will allocate the lookaside buffer itself
37using sqlite3_malloc().
38The second argument is the size of each lookaside buffer slot.
39The third argument is the number of slots.
40The size of the buffer in the first argument must be greater than or
41equal to the product of the second and third arguments.
42The buffer must be aligned to an 8-byte boundary.
43If the second argument to SQLITE_DBCONFIG_LOOKASIDE is not a multiple
44of 8, it is internally rounded down to the next smaller multiple of
458.
46The lookaside memory configuration for a database connection can only
47be changed when that connection is not currently using lookaside memory,
48or in other words when the "current value" returned by sqlite3_db_status(D,SQLITE_CONFIG_LOOKASIDE,...)
49is zero.
50Any attempt to change the lookaside memory configuration when lookaside
51memory is in use leaves the configuration unchanged and returns SQLITE_BUSY.
52.It SQLITE_DBCONFIG_ENABLE_FKEY
53This option is used to enable or disable the enforcement of foreign key constraints.
54There should be two additional arguments.
55The first argument is an integer which is 0 to disable FK enforcement,
56positive to enable FK enforcement or negative to leave FK enforcement
57unchanged.
58The second parameter is a pointer to an integer into which is written
590 or 1 to indicate whether FK enforcement is off or on following this
60call.
61The second parameter may be a NULL pointer, in which case the FK enforcement
62setting is not reported back.
63.It SQLITE_DBCONFIG_ENABLE_TRIGGER
64This option is used to enable or disable  triggers.
65There should be two additional arguments.
66The first argument is an integer which is 0 to disable triggers, positive
67to enable triggers or negative to leave the setting unchanged.
68The second parameter is a pointer to an integer into which is written
690 or 1 to indicate whether triggers are disabled or enabled following
70this call.
71The second parameter may be a NULL pointer, in which case the trigger
72setting is not reported back.
73.It SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
74This option is used to enable or disable the two-argument version of
75the fts3_tokenizer() function which is part of the
76FTS3 full-text search engine extension.
77There should be two additional arguments.
78The first argument is an integer which is 0 to disable fts3_tokenizer()
79or positive to enable fts3_tokenizer() or negative to leave the setting
80unchanged.
81The second parameter is a pointer to an integer into which is written
820 or 1 to indicate whether fts3_tokenizer is disabled or enabled following
83this call.
84The second parameter may be a NULL pointer, in which case the new setting
85is not reported back.
86.It SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
87This option is used to enable or disable the sqlite3_load_extension()
88interface independently of the load_extension() SQL
89function.
90The sqlite3_enable_load_extension()
91API enables or disables both the C-API sqlite3_load_extension()
92and the SQL function load_extension().
93There should be two additional arguments.
94When the first argument to this interface is 1, then only the C-API
95is enabled and the SQL function remains disabled.
96If the first argment to this interface is 0, then both the C-API and
97the SQL function are disabled.
98If the first argument is -1, then no changes are made to state of either
99the C-API or the SQL function.
100The second parameter is a pointer to an integer into which is written
1010 or 1 to indicate whether sqlite3_load_extension()
102interface is disabled or enabled following this call.
103The second parameter may be a NULL pointer, in which case the new setting
104is not reported back.
105.El
106.Pp
107.Sh SEE ALSO
108.Xr sqlite3 3 ,
109.Xr sqlite3_db_config 3 ,
110.Xr sqlite3_db_status 3 ,
111.Xr sqlite3_enable_load_extension 3 ,
112.Xr sqlite3_load_extension 3 ,
113.Xr sqlite3_malloc 3 ,
114.Xr SQLITE_OK 3 ,
115.Xr SQLITE_CONFIG_SINGLETHREAD 3
116