VSQLite++ 0.3
Loading...
Searching...
No Matches
function.hpp File Reference

Utilities for binding C++ callables as SQLite scalar, aggregate, or window functions. More...

#include <concepts>
#include <cstddef>
#include <exception>
#include <format>
#include <functional>
#include <limits>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
#include <sqlite/database_exception.hpp>
#include <sqlite/private/private_accessor.hpp>
#include <sqlite3.h>
Include dependency graph for function.hpp:

Go to the source code of this file.

Classes

struct  sqlite::v2::function_options
 Options passed alongside a callable when registering it with sqlite3_create_function_v2. More...
struct  sqlite::v2::detail::function_holder< Callable >
struct  sqlite::v2::detail::callable_traits< R(Args...), void >
struct  sqlite::v2::detail::callable_traits< R(*)(Args...), void >
struct  sqlite::v2::detail::callable_traits< R(&)(Args...), void >
struct  sqlite::v2::detail::callable_traits< R(Class::*)(Args...), void >
struct  sqlite::v2::detail::callable_traits< R(Class::*)(Args...) const, void >
struct  sqlite::v2::detail::callable_traits< Callable, std::void_t< decltype(&Callable::operator())> >
struct  sqlite::v2::detail::callable_traits< Callable const, std::enable_if_t<!std::is_function_v< Callable >, void > >
struct  sqlite::v2::detail::callable_traits< Callable volatile, std::enable_if_t<!std::is_function_v< Callable >, void > >
struct  sqlite::v2::detail::callable_traits< Callable const volatile, std::enable_if_t<!std::is_function_v< Callable >, void > >
struct  sqlite::v2::detail::callable_traits< Callable &, std::enable_if_t<!std::is_function_v< std::remove_reference_t< Callable > >, void > >
struct  sqlite::v2::detail::callable_traits< Callable &&, std::enable_if_t<!std::is_function_v< std::remove_reference_t< Callable > >, void > >
struct  sqlite::v2::detail::is_optional< T >
struct  sqlite::v2::detail::is_optional< std::optional< U > >
struct  sqlite::v2::detail::argument_converter< T >
struct  sqlite::v2::detail::argument_converter< bool >
struct  sqlite::v2::detail::argument_converter< std::string_view >
struct  sqlite::v2::detail::argument_converter< Text >
struct  sqlite::v2::detail::argument_converter< std::span< const unsigned char > >
struct  sqlite::v2::detail::argument_converter< std::span< const std::byte > >
struct  sqlite::v2::detail::argument_converter< Vector >
struct  sqlite::v2::detail::argument_converter< sqlite3_value * >
struct  sqlite::v2::detail::argument_converter< sqlite3_value const * >
struct  sqlite::v2::detail::argument_converter< std::optional< T > >
struct  sqlite::v2::detail::result_writer< void >
struct  sqlite::v2::detail::result_writer< null_type >
struct  sqlite::v2::detail::result_writer< std::nullptr_t >
struct  sqlite::v2::detail::result_writer< T >
struct  sqlite::v2::detail::result_writer< bool >
struct  sqlite::v2::detail::result_writer< std::string_view >
struct  sqlite::v2::detail::result_writer< Text >
struct  sqlite::v2::detail::result_writer< std::span< const unsigned char > >
struct  sqlite::v2::detail::result_writer< std::span< const std::byte > >
struct  sqlite::v2::detail::result_writer< Vector >
struct  sqlite::v2::detail::result_writer< std::optional< T > >

Namespaces

namespace  sqlite
namespace  sqlite::v2
namespace  sqlite::v2::detail

Functions

void sqlite::v2::detail::throw_null_argument_error ()
void sqlite::v2::detail::result_text (sqlite3_context *ctx, std::string_view view)
template<typename Callable, std::size_t... Index>
decltype(auto) sqlite::v2::detail::invoke_with_arguments (function_holder< Callable > &holder, sqlite3_value **argv, std::index_sequence< Index... >)
template<typename Callable>
void sqlite::v2::detail::destroy_holder (void *data)
template<typename Callable>
void sqlite::v2::detail::function_entry (sqlite3_context *ctx, int argc, sqlite3_value **argv)
int sqlite::v2::detail::compose_text_rep (function_options const &options)
std::string sqlite::v2::detail::make_function_error (std::string_view name)
template<typename Callable>
void sqlite::v2::create_function (connection &con, std::string_view name, Callable &&callable, function_options options={})

Detailed Description

Utilities for binding C++ callables as SQLite scalar, aggregate, or window functions.

This header provides the heavy lifting to translate between sqlite3_value* arguments and strongly typed C++ invocables, handling optional/nullable parameters and propagating errors.

Definition in file function.hpp.