xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_create_module.3 (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1.Dd December 19, 2018
2.Dt SQLITE3_CREATE_MODULE 3
3.Os
4.Sh NAME
5.Nm sqlite3_create_module ,
6.Nm sqlite3_create_module_v2
7.Nd Register A Virtual Table Implementation
8.Sh SYNOPSIS
9.Ft int
10.Fo sqlite3_create_module
11.Fa "sqlite3 *db"
12.Fa "const char *zName"
13.Fa "const sqlite3_module *p"
14.Fa "void *pClientData          "
15.Fc
16.Ft int
17.Fo sqlite3_create_module_v2
18.Fa "sqlite3 *db"
19.Fa "const char *zName"
20.Fa "const sqlite3_module *p"
21.Fa "void *pClientData"
22.Fa "void(*xDestroy)(void*)     "
23.Fc
24.Sh DESCRIPTION
25These routines are used to register a new virtual table module
26name.
27Module names must be registered before creating a new virtual table
28using the module and before using a preexisting virtual table
29for the module.
30.Pp
31The module name is registered on the database connection
32specified by the first parameter.
33The name of the module is given by the second parameter.
34The third parameter is a pointer to the implementation of the virtual table module.
35The fourth parameter is an arbitrary client data pointer that is passed
36through into the xCreate and xConnect methods of the
37virtual table module when a new virtual table is be being created or
38reinitialized.
39.Pp
40The sqlite3_create_module_v2() interface has a fifth parameter which
41is a pointer to a destructor for the pClientData.
42SQLite will invoke the destructor function (if it is not NULL) when
43SQLite no longer needs the pClientData pointer.
44The destructor will also be invoked if the call to sqlite3_create_module_v2()
45fails.
46The sqlite3_create_module() interface is equivalent to sqlite3_create_module_v2()
47with a NULL destructor.
48.Sh SEE ALSO
49.Xr sqlite3 3 ,
50.Xr sqlite3_module 3
51