From 8e54e4855b93996b0221ea973f5dadd03cc40f9d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 10 Nov 2014 16:04:58 +0200 Subject: Implement {query,execute}_{one,value}() shortcut functions Useful in situations where the query is know to return at most one element (*_one) or exactly one element (*_value). --- reference/bug/list | 28 ++++++++++++++++++++++++++++ reference/feature/query/list | 6 ++++++ reference/list | 28 ---------------------------- 3 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 reference/bug/list create mode 100644 reference/feature/query/list delete mode 100644 reference/list (limited to 'reference') diff --git a/reference/bug/list b/reference/bug/list new file mode 100644 index 0000000..8d95506 --- /dev/null +++ b/reference/bug/list @@ -0,0 +1,28 @@ ++ stderr_tracer doesn't trace statement preparation [2.4.0] + + If a statement is invalid, then it will fail during preparation. However, + currently, there is no way to see that statement since stderr_tracer doesn't + trace this event. + + Options: + + * trace preparation by default - too much info + * allow changing behavior at runtime - not thread safe + * support via bool flag and make user instantiate - burdensome + * support via bool flag and instantiate stderr_full_tracer - code bloat + but seems the best option + ++ C++11 support is not trully header only [c++11] + + Added a new class details::function_wrapper, which can be used similarly + to std::function. In particular, C++11 code can construct a + function_wrapper from a lambda, or a std::function, or another + function_wrapper. But it differs from std::function in this respect: + C++98 code can declare and define function_wrapper objects. + + Now all builds (98 or 11) of libodb keep their callbacks in + function_wrappers. C++11 user code can register std::functions or lambdas as + callbacks, and the glue that turns those into function_wrappers for libodb is + header-only. + + This technique is currently used for data migrations and query factories. diff --git a/reference/feature/query/list b/reference/feature/query/list new file mode 100644 index 0000000..94b6477 --- /dev/null +++ b/reference/feature/query/list @@ -0,0 +1,6 @@ ++ Shortcut query() call for queries that always return one element [2.4.0] + + Can be useful for aggregate queries, etc. + + Also added query_value() which returns the result by value. Very + handy when working with aggregate views. diff --git a/reference/list b/reference/list deleted file mode 100644 index 8d95506..0000000 --- a/reference/list +++ /dev/null @@ -1,28 +0,0 @@ -+ stderr_tracer doesn't trace statement preparation [2.4.0] - - If a statement is invalid, then it will fail during preparation. However, - currently, there is no way to see that statement since stderr_tracer doesn't - trace this event. - - Options: - - * trace preparation by default - too much info - * allow changing behavior at runtime - not thread safe - * support via bool flag and make user instantiate - burdensome - * support via bool flag and instantiate stderr_full_tracer - code bloat - but seems the best option - -+ C++11 support is not trully header only [c++11] - - Added a new class details::function_wrapper, which can be used similarly - to std::function. In particular, C++11 code can construct a - function_wrapper from a lambda, or a std::function, or another - function_wrapper. But it differs from std::function in this respect: - C++98 code can declare and define function_wrapper objects. - - Now all builds (98 or 11) of libodb keep their callbacks in - function_wrappers. C++11 user code can register std::functions or lambdas as - callbacks, and the glue that turns those into function_wrappers for libodb is - header-only. - - This technique is currently used for data migrations and query factories. -- cgit v1.1