MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
postgresql_prepared_result.hpp
1#ifndef MSTL_DATABASE_POSTGRESQL_PREPARED_RESULT_HPP__
2#define MSTL_DATABASE_POSTGRESQL_PREPARED_RESULT_HPP__
3#ifdef MSTL_SUPPORT_POSTGRESQL__
4#include "postgresql_result.hpp"
6
7class MSTL_API postgresql_prepared_result final : public idb_prepared_result {
8private:
9 unique_ptr<postgresql_tb_result> impl_ = nullptr;
10
11public:
12 explicit postgresql_prepared_result(::PGresult* result) noexcept
13 : impl_(make_unique<postgresql_tb_result>(result, true)) {}
14
15 ~postgresql_prepared_result() override = default;
16
17 MSTL_NODISCARD bool empty() const noexcept override { return impl_->empty(); }
18 MSTL_NODISCARD bool next() noexcept override { return impl_->next(); }
19
20 MSTL_NODISCARD size_type row_count() const noexcept override { return impl_->row_count(); }
21 MSTL_NODISCARD size_type column_count() const noexcept override { return impl_->column_count(); }
22 MSTL_NODISCARD const vector<string_view>& column_names() const override { return impl_->column_names(); }
23
24 MSTL_NODISCARD string_view get(size_type index) const override { return impl_->get(index); }
25 MSTL_NODISCARD bool get_bool(size_type index) const override { return impl_->get_bool(index); }
26 MSTL_NODISCARD int8_t get_int8(size_type index) const override { return impl_->get_int8(index); }
27 MSTL_NODISCARD int16_t get_int16(size_type index) const override { return impl_->get_int16(index); }
28 MSTL_NODISCARD int32_t get_int32(size_type index) const override { return impl_->get_int32(index); }
29 MSTL_NODISCARD int64_t get_int64(size_type index) const override { return impl_->get_int64(index); }
30 MSTL_NODISCARD float32_t get_float32(size_type index) const override { return impl_->get_float32(index); }
31 MSTL_NODISCARD float64_t get_float64(size_type index) const override { return impl_->get_float64(index); }
32 MSTL_NODISCARD decimal_t get_decimal(size_type index) const override { return impl_->get_decimal(index); }
33 MSTL_NODISCARD vector<char> get_blob(size_type index) const override { return impl_->get_blob(index); }
34 MSTL_NODISCARD string get_set(size_type index) const override { return impl_->get_set(index); }
35 MSTL_NODISCARD uint64_t get_bit(size_type index) const override { return impl_->get_bit(index); }
36 MSTL_NODISCARD _MSTL date get_date(size_type index) const override { return impl_->get_date(index); }
37 MSTL_NODISCARD _MSTL time get_time(size_type index) const override { return impl_->get_time(index); }
38 MSTL_NODISCARD _MSTL datetime get_datetime(size_type index) const override { return impl_->get_datetime(index); }
39 MSTL_NODISCARD _MSTL timestamp get_timestamp(size_type index) const override { return impl_->get_timestamp(index); }
40 MSTL_NODISCARD string get_string(size_type index) const override { return impl_->get_string(index); }
41 MSTL_NODISCARD string_view get_enum(size_type index) const override { return impl_->get_enum(index); }
42};
43
45#endif
46#endif // MSTL_DATABASE_POSTGRESQL_PREPARED_RESULT_HPP__
MSTL_CONSTEXPR20 pointer get() const noexcept
获取原始指针
MSTL_ALWAYS_INLINE enable_if_t< is_void_v< T >, future_result_t< T > > get(future< T > &f)
通用future结果获取函数
float float32_t
32位单精度浮点数类型
long double decimal_t
扩展精度浮点数类型
long long int64_t
64位有符号整数类型
double float64_t
64位双精度浮点数类型
unsigned long long uint64_t
64位无符号整数类型
short int16_t
16位有符号整数类型
int int32_t
32位有符号整数类型
signed char int8_t
8位有符号整数类型
constexpr Iterator next(Iterator iter, iter_difference_t< Iterator > n=1)
获取迭代器的后一个位置
#define _MSTL
全局命名空间MSTL前缀
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
MSTL_NODISCARD MSTL_ALWAYS_INLINE constexpr bool empty(const Container &cont) noexcept(noexcept(cont.empty()))
检查容器是否为空
MSTL_CONSTEXPR20 unique_ptr< T > make_unique(Args &&... args)
创建unique_ptr