xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_module.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_MODULE 3
3.Os
4.Sh NAME
5.Nm sqlite3_module
6.Nd virtual table object
7.Sh SYNOPSIS
8.In sqlite3.h
9.Vt struct sqlite3_module ;
10.Sh DESCRIPTION
11This structure, sometimes called a "virtual table module", defines
12the implementation of a virtual table.
13This structure consists mostly of methods for the module.
14.Pp
15A virtual table module is created by filling in a persistent instance
16of this structure and passing a pointer to that instance to
17.Fn sqlite3_create_module
18or
19.Fn sqlite3_create_module_v2 .
20The registration remains valid until it is replaced by a different
21module or until the database connection closes.
22The content of this structure must not change while it is registered
23with any database connection.
24.Sh IMPLEMENTATION NOTES
25These declarations were extracted from the
26interface documentation at line 7273.
27.Bd -literal
28struct sqlite3_module {
29  int iVersion;
30  int (*xCreate)(sqlite3*, void *pAux,
31               int argc, const char *const*argv,
32               sqlite3_vtab **ppVTab, char**);
33  int (*xConnect)(sqlite3*, void *pAux,
34               int argc, const char *const*argv,
35               sqlite3_vtab **ppVTab, char**);
36  int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*);
37  int (*xDisconnect)(sqlite3_vtab *pVTab);
38  int (*xDestroy)(sqlite3_vtab *pVTab);
39  int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor);
40  int (*xClose)(sqlite3_vtab_cursor*);
41  int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr,
42                int argc, sqlite3_value **argv);
43  int (*xNext)(sqlite3_vtab_cursor*);
44  int (*xEof)(sqlite3_vtab_cursor*);
45  int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int);
46  int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid);
47  int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *);
48  int (*xBegin)(sqlite3_vtab *pVTab);
49  int (*xSync)(sqlite3_vtab *pVTab);
50  int (*xCommit)(sqlite3_vtab *pVTab);
51  int (*xRollback)(sqlite3_vtab *pVTab);
52  int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName,
53                       void (**pxFunc)(sqlite3_context*,int,sqlite3_value**),
54                       void **ppArg);
55  int (*xRename)(sqlite3_vtab *pVtab, const char *zNew);
56  /* The methods above are in version 1 of the sqlite_module object. Those
57  ** below are for version 2 and greater. */
58  int (*xSavepoint)(sqlite3_vtab *pVTab, int);
59  int (*xRelease)(sqlite3_vtab *pVTab, int);
60  int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
61  /* The methods above are in versions 1 and 2 of the sqlite_module object.
62  ** Those below are for version 3 and greater. */
63  int (*xShadowName)(const char*);
64  /* The methods above are in versions 1 through 3 of the sqlite_module object.
65  ** Those below are for version 4 and greater. */
66  int (*xIntegrity)(sqlite3_vtab *pVTab, const char *zSchema,
67                    const char *zTabName, int mFlags, char **pzErr);
68};
69.Ed
70.Sh SEE ALSO
71.Xr sqlite3 3 ,
72.Xr sqlite3_create_module 3
73