diff options
author | Michael Shepanski <michael@codesynthesis.com> | 2014-11-05 14:23:54 +1100 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-11-10 16:48:59 +0200 |
commit | 64b27b86025d160e49bf617143d80671ccb1e0e4 (patch) | |
tree | 1abc0df10d797d0d845e0590c1cb9a077e4a42af /common/query/one/test.hxx | |
parent | dee5f10d1d75eee43596ad1dfb47ecec9e0b1307 (diff) |
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).
Diffstat (limited to 'common/query/one/test.hxx')
-rw-r--r-- | common/query/one/test.hxx | 27 |
1 files changed, 27 insertions, 0 deletions
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 <string> + +#pragma db object +struct object +{ + object (unsigned long id) + : id_ (id) + { + } + + object () + { + } + + #pragma db id + unsigned long id_; + std::string str_; +}; + +#endif // TEST_HXX |