From 64b27b86025d160e49bf617143d80671ccb1e0e4 Mon Sep 17 00:00:00 2001 From: Michael Shepanski Date: Wed, 5 Nov 2014 14:23:54 +1100 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). --- common/query/one/test.hxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 common/query/one/test.hxx (limited to 'common/query/one/test.hxx') diff --git a/common/query/one/test.hxx b/common/query/one/test.hxx new file mode 100644 index 0000000..1a9c35e --- /dev/null +++ b/common/query/one/test.hxx @@ -0,0 +1,27 @@ +// file : common/query/one/test.hxx +// copyright : Copyright (c) 2009-2014 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + std::string str_; +}; + +#endif // TEST_HXX -- cgit v1.1