SQLite Forum

Confusing sqlite3_vtab_distinct
Login

Confusing sqlite3_vtab_distinct

(1) By anonymous on 2022-01-22 04:45:17 [source]

The documentation for sqlite3_vtab_distinct is confusing; maybe adding examples would be helpful. I am also not sure why it isn't a field of the sqlite3_index_info structure instead (that can just be read directly).

(2) By Larry Brasfield (larrybr) on 2022-01-22 05:42:59 in reply to 1 [link] [source]

The only documentation I see, on the 1/3 day old sqlite3_vtab_distinct branch (which is the only place anything about this appears publicly), is embedded in the code. Documentation located in code with the CAPI3REF: tag is usually not expected to do the whole job of documenting the API. Instead, it is for details specific to each API, and needed to either write calls into it or remind code readers (and writers!) what has been promised at the interface. It is not expected to address how and when the API should be used, particularly when a datum or entry point is part of a group which operates together such as the optimization interplay between the VDBE compiler and a vtab implementation.

It is way too early in the life of this particular API to be worrying about clarity of what is likely to be only a portion of its documentation.

I do not understand why you think the (possibly) dynamically varying information to be returned by that API function should instead be ensconced in a (an extension of) the sqlite3_index_info struct. For the library to convey that information through that struct, it would have to compute it ahead of time without regard for whether there is any use for it in the particular virtual table implementation.

There will undoubtedly be a beta drop of the library before that feature becomes part of a release. I do not mean to discourage feedback, and feedback on the API design and docs are welcome, anytime for the docs and before a release for new API details. But today, it's just too soon to worry clarity and how-to issues.

(3) By Richard Hipp (drh) on 2022-01-22 12:41:15 in reply to 1 [link] [source]

The documentation for sqlite3_vtab_distinct is confusing

That new API has only been in the tree for less than 13 hours. It has not landed on trunk, yet. It doesn't yet fully work. Please allow me a few more days before insisting on detailed documentation.

(4) By anonymous on 2022-01-22 22:17:01 in reply to 3 [link] [source]

Well, it has been improved now, and now the documentation is much better; now it isn't confusing like it was before.