On Fri, May 18, 2018 at 12:02 PM R Smith <ryansmit...@gmail.com> wrote:

> On 2018/05/18 11:50 AM, Lloyd wrote:
> > I have a "buffer" containing data read from a file-based sqlite database.
> > Is there any possibility for processing this "buffer" to query the data?
>
> But I imagine you had a more specific question in mind - please ask
> exactly what you would like to know, and make sure to include all the
> details what we need to know to be able to give answers or advice that
> somewhat resemble the truth.
>

I concur.


> (Is the buffer a queried cursor? a part of the file?, the entire file?
> Does it also exist on a disk? If so, why not read the file? is it
> embedded in another file? Can we put the file to disk or is the disk a
> no-go zone? Are you a DB admin, or a programmer? i.e. Are you stuck with
> someone else's data or are you able to program a custom file-system
> interface (see vfs documentation)?  There are many solutions but we
> don't know which one is best, or if perhaps none of them will work,
> since we do not have all the information.)
>

Indeed, I didn't realize the "buffer" could be arbitrary data not the
"SQLite format".
Then I guess you might want to look into virtual tables:
https://www.sqlite.org/vtab.html

Many of us expose in-memory C/C++/etc... data structures as SQLite vtables,
which can then be queried. The learning curve is a little steep, there are
plenty
of examples in the SQLite repo. Maybe that's what you had in mind?

Otherwise, just "insert" the data into an in-memory DB, and query it.
Much simpler than implementing vtable(s), assuming your data does
not change "live", in which case vtables is a better choice IMHO. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to