Small. Fast. Reliable.
Choose any three.

SQLite C Interface

Register A Virtual Table Implementation

int sqlite3_create_module(
  sqlite3 *db,               /* SQLite connection to register module with */
  const char *zName,         /* Name of the module */
  const sqlite3_module *p,   /* Methods for the module */
  void *pClientData          /* Client data for xCreate/xConnect */
);
int sqlite3_create_module_v2(
  sqlite3 *db,               /* SQLite connection to register module with */
  const char *zName,         /* Name of the module */
  const sqlite3_module *p,   /* Methods for the module */
  void *pClientData,         /* Client data for xCreate/xConnect */
  void(*xDestroy)(void*)     /* Module destructor function */
);

R-19069-01001:[These routines are used to register a new virtual table module name. ] R-33496-49460:[Module names must be registered before creating a new virtual table using the module and before using a preexisting virtual table for the module. ]

R-62782-27113:[The module name is registered on the database connection specified by the first parameter. ] R-59843-56897:[The name of the module is given by the second parameter. ] R-52722-37312:[The third parameter is a pointer to the implementation of the virtual table module. ] R-06396-00487:[The fourth parameter is an arbitrary client data pointer that is passed through into the xCreate and xConnect methods of the virtual table module when a new virtual table is be being created or reinitialized. ]

R-17644-02150:[The sqlite3_create_module_v2() interface has a fifth parameter which is a pointer to a destructor for the pClientData. ] R-25726-27770:[SQLite will invoke the destructor function (if it is not NULL) when SQLite no longer needs the pClientData pointer. ] R-19406-19221:[The destructor will also be invoked if the call to sqlite3_create_module_v2() fails. ] R-52979-05948:[The sqlite3_create_module() interface is equivalent to sqlite3_create_module_v2() with a NULL destructor. ]

R-36091-24060:[If the third parameter (the pointer to the sqlite3_module object) is NULL then no new module is created and any existing modules with the same name are dropped. ]

See also: sqlite3_drop_modules()

See also lists of Objects, Constants, and Functions.