struct sqlite3_module {
int iVersion;
int(* xCreate)(sqlite3 *,无效* pAux,
int argc,const char * const * argv,
sqlite3_vtab ** ppVTab,char **);
int(* xConnect)(sqlite3 *,无效* pAux,
int argc,const char * const * argv,
sqlite3_vtab ** ppVTab,char **);
int(* xBestIndex)(sqlite3_vtab * pVTab,sqlite3_index_info *);
int(* xDisconnect)(sqlite3_vtab * pVTab);
int(* xDestroy)(sqlite3_vtab * pVTab);
int(* xOpen)(sqlite3_vtab * pVTab,sqlite3_vtab_cursor ** ppCursor);
int(* xClose)(sqlite3_vtab_cursor *);
int(* xFilter)(sqlite3_vtab_cursor *,int idxNum,const char * idxStr,
int argc,sqlite3_value ** argv);
int(* xNext)(sqlite3_vtab_cursor *);
int(* xEof)(sqlite3_vtab_cursor *);
int(* xColumn)(sqlite3_vtab_cursor *,sqlite3_context *,int);;
int(* xRowid)(sqlite3_vtab_cursor *,sqlite3_int64 * pRowid);
int(* xUpdate)(sqlite3_vtab *,int,sqlite3_value **,sqlite3_int64 *);
int(* xBegin)(sqlite3_vtab * pVTab);
int(* xSync)(sqlite3_vtab * pVTab);
int(* xCommit)(sqlite3_vtab * pVTab);
int(* xRollback)(sqlite3_vtab * pVTab);
int(* xFindFunction)(sqlite3_vtab * pVtab,int nArg,const char * zName,
void(** pxFunc)(sqlite3_context *,int,sqlite3_value **),
void ** ppArg);
int(* xRename)(sqlite3_vtab * pVtab,const char * zNew);
/ *上面的方法在sqlite_module对象的版本1中。那些
以下**适用于版本2和更高版本。* /
int(* xSavepoint)(sqlite3_vtab * pVTab,int);
int(* xRelease)(sqlite3_vtab * pVTab,int);
int(* xRollbackTo)(sqlite3_vtab * pVTab,int);
/ *上面的方法在sqlite_module对象的版本1和2中。
**以下内容适用于版本3和更高版本。* /
int(* xShadowName)(const char *);
};
这种结构有时称为“虚拟表模块”,它定义了虚拟表的实现。该结构主要由模块的方法组成。
通过填充此结构的持久实例并将该实例的指针传递到sqlite3_create_module()或sqlite3_create_module_v2()来创建虚拟表模块。该注册将一直保持有效,直到被其他模块替换或数据库连接关闭为止。向任何数据库连接注册该结构时,其内容均不得更改。