diff options
author | John Turner <jturner.usa@gmail.com> | 2025-09-14 00:16:10 -0400 |
---|---|---|
committer | John Turner <jturner.usa@gmail.com> | 2025-09-14 00:16:10 -0400 |
commit | efcea3a80da7c4479d5fe168435ecc9fd06bdc72 (patch) | |
tree | 5cb0177e17b1b00a177f2e830e809f606334571b /doc/reference/result.adoc | |
download | sqlite-kv-bench-efcea3a80da7c4479d5fe168435ecc9fd06bdc72.tar.gz |
Squashed 'subprojects/boost-sqlite/' content from commit 3378e35
git-subtree-dir: subprojects/boost-sqlite
git-subtree-split: 3378e353705271e569cf4ba15c467b840a39798c
Diffstat (limited to 'doc/reference/result.adoc')
-rw-r--r-- | doc/reference/result.adoc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/reference/result.adoc b/doc/reference/result.adoc new file mode 100644 index 0000000..0471b95 --- /dev/null +++ b/doc/reference/result.adoc @@ -0,0 +1,40 @@ +== `sqlite/result.hpp` + +The result header is used by functions and vtables to turn resulting values into +sqlite values. The `tag_invoke` interface is public and meant to extended. + +That is, implementing `tag_invoke(sqlite::set_result_tag, sqlite3_context, T);` +will enable `T` to be used as a result by sqlite. + +[source,cpp] +---- +// The tag +struct set_result_tag {}; + +// built-in result type +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, blob b); +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, zero_blob zb); +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, double dbl) { sqlite3_result_double(ctx, dbl); } +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, sqlite3_int64 value);inline void tag_invoke(set_result_tag, sqlite3_context * ctx, std::int64_t value); +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, std::nullptr_t); +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, string_view str); +template<typename String> +inline auto tag_invoke(set_result_tag, sqlite3_context * ctx, String && str); +inline void tag_invoke(set_result_tag, sqlite3_context * , variant2::monostate); +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, const value & val); +template<typename ... Args> +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, const variant2::variant<Args...> & var); + +template<typename T> +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, std::unique_ptr<T> ptr); +template<typename T> +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, std::unique_ptr<T, void(*)(T*)> ptr); +template<typename T, typename Deleter> +inline auto tag_invoke(set_result_tag, sqlite3_context * ctx, std::unique_ptr<T> ptr); +inline void tag_invoke(set_result_tag, sqlite3_context * ctx, error err); +template<typename T> +inline void tag_invoke(set_result_tag tag, sqlite3_context * ctx, result<T> res); +inline void tag_invoke(set_result_tag tag, sqlite3_context * ctx, result<void> res): +---- + + |