SQLite Forum

Virtual Table based on template templatevtab loads OK but "no such module"
Login

Virtual Table based on template templatevtab loads OK but "no such module"

(1) By anonymous on 2021-04-26 11:34:57 [source]

Hello all,

I have compiled the templatevtab example, and can load the shared object with .load templatevtab.so. pragma module_list shows it as loaded:

sqlite> pragma module_list; zipfile completion fsdir mynewvtab sqlite_stmt json_tree json_each sqlite_dbpage fts3 fts4 sqlite_dbptr fts3tokenize sqlite_dbdata generate_series fts5vocab dbstat fts5 rtree rtree_i32 fts4aux geopoly

But when I try to create a virtual table:

sqlite> create virtual table blahfasel using mynewvtab; Error: no such module: mynewvtab

What could be the reason? fts3, for example, works fine.

best regards

Ernst-Georg

(2) By anonymous on 2021-04-26 12:17:41 in reply to 1 [link] [source]

That is:

I have compiled the templatevtab example, and can load the shared object with .load mynewvtab.so.

of course.

(3) By anonymous on 2021-04-26 13:19:48 in reply to 2 [link] [source]

Silly me. It's EPONYMOUS...

"and eponymous-only table"

This is the reason, why the CREATE VIRTUAL TABLE fails. However, the Error Message could be more specific...

(4) By little-brother on 2021-04-27 10:28:51 in reply to 1 [link] [source]

You should define xCreate and xDestroy in module structure. They can be the same as xConnect and xDisconnect.