SQLite Forum

Is the lifetime of argv in sqlite3_module::xConnect greater than sqlite3_module::xFilter?
Login
There are at least two possible sources for the module name passed to the xConnect method.

- it could be the argument passed to the sqlite3_create_module[_v2] function, in which case it's lifetime is determined by you, the caller

- it could be a copy of the above, stored in SQLite internal structures associated with the module, which would then probably be valid until the module is dropped

- it could be the argument given in the CREATE VIRTUAL TABLE statement, in which case it could reside in the input buffer, or inside the SQL program created to process the statement, or somewhere else convenient for SQLite; all of which  probably expire after your xConnect function returns