xref: /netbsd-src/external/public-domain/sqlite/man/sqlite3_vtab.3 (revision b9988867a8ad969c45a52aa7628bc932ec98d46b)
1.Dd January 24, 2024
2.Dt SQLITE3_VTAB 3
3.Os
4.Sh NAME
5.Nm sqlite3_vtab
6.Nd virtual table instance object
7.Sh SYNOPSIS
8.In sqlite3.h
9.Vt struct sqlite3_vtab ;
10.Sh DESCRIPTION
11Every virtual table module implementation uses
12a subclass of this object to describe a particular instance of the
13virtual table.
14Each subclass will be tailored to the specific needs of the module
15implementation.
16The purpose of this superclass is to define certain fields that are
17common to all module implementations.
18.Pp
19Virtual tables methods can set an error message by assigning a string
20obtained from
21.Fn sqlite3_mprintf
22to zErrMsg.
23The method should take care that any prior string is freed by a call
24to
25.Fn sqlite3_free
26prior to assigning a new string to zErrMsg.
27After the error message is delivered up to the client application,
28the string will be automatically freed by sqlite3_free() and the zErrMsg
29field will be zeroed.
30.Sh IMPLEMENTATION NOTES
31These declarations were extracted from the
32interface documentation at line 7593.
33.Bd -literal
34struct sqlite3_vtab {
35  const sqlite3_module *pModule;  /* The module for this virtual table */
36  int nRef;                       /* Number of open cursors */
37  char *zErrMsg;                  /* Error message from sqlite3_mprintf() */
38  /* Virtual table implementations will typically add additional fields */
39};
40.Ed
41.Sh SEE ALSO
42.Xr sqlite3_malloc 3 ,
43.Xr sqlite3_module 3 ,
44.Xr sqlite3_mprintf 3
45