Skip to content

Instantly share code, notes, and snippets.

@gahr
Created August 20, 2021 14:05
Show Gist options
  • Select an option

  • Save gahr/d83bf35410220cb5e47fe2a6ab2cc72b to your computer and use it in GitHub Desktop.

Select an option

Save gahr/d83bf35410220cb5e47fe2a6ab2cc72b to your computer and use it in GitHub Desktop.
I'm implementing a vtable module.
In `xColumn`, I call `sqlite3_result_*` to produce the value, but I also have additional metadata about the value (say, a `void*`) that I need to make available to the callback passed to `sqlite3_exec`.
The problem is that the only state I have (4th arg to `sqlite3_exec`, then 1st arg to callback), is not available when `xColumn` is called. And whatever state I might have in `xColumn` is not available at callback time.
Is there a preferred way to make some state (e.g., the one I have at `sqlite3_exec` time) available at `xColumn` time?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment