31#ifndef MYSQLX_RESULT_H
32#define MYSQLX_RESULT_H
42#include "collations.h"
61template <class Res, class Op> class Executable;
74 using WarningList = internal::Result_detail::WarningList;
80 unsigned getWarningsCount()
const
83 return Base::get_warning_count();
90 WarningList getWarnings()
93 return Base::get_warnings();
101 Warning getWarning(
unsigned pos)
104 return Base::get_warning(pos);
116 uint64_t getAffectedItemsCount()
const
119 return Result_detail::get_affected_rows();
133 Result_common(Result_common &&other)
135 : Base(std::move(other))
139 Result_common& operator=(Result_common &&other)
142 Base::operator=(std::move(other));
147 Result_common(common::Result_init &init)
183 :
public internal::Result_common<internal::Result_detail>
198 return Result_detail::get_auto_increment();
211 return Result_detail::get_generated_ids();
218 Result(common::Result_init &init)
219 : Result_common(init)
222 template <
class Res,
class Op>
240enum class Type : unsigned short
243#define TYPE_ENUM(X,N) X=N,
245 RESULT_TYPE_LIST(TYPE_ENUM)
303#define TYPE_NAME(T,X) case Type::T: return #T;
307 RESULT_TYPE_LIST(TYPE_NAME)
309 THROW(
"Unknown type");
314std::ostream& operator<<(std::ostream &out,
Type t)
327 :
public virtual common::Printable
328 ,
private internal::Column_detail
335 return Column_detail::get_schema_name();
340 string getTableName() const
343 return Column_detail::get_table_name();
348 string getTableLabel() const
351 return Column_detail::get_table_label();
356 string getColumnName() const
359 return Column_detail::get_name();
364 string getColumnLabel() const
367 return Column_detail::get_label();
375 return Type(Column_detail::get_type());
392 unsigned long getLength()
const
395 return Column_detail::get_length();
400 unsigned short getFractionalDigits() const
403 return Column_detail::get_decimals();
408 bool isNumberSigned() const
411 return Column_detail::is_signed();
416 CharacterSet getCharacterSet() const
419 return Column_detail::get_charset();
436 return Column_detail::get_collation();
454 return Column_detail::is_padded();
462 using Column_detail::Impl;
466 : Column_detail(impl)
476 void print(std::ostream &out)
const
480 Column_detail::print(out);
488 struct INTERNAL Access;
503void Columns_detail<Column>::init(
const Result_detail::Impl&);
508extern template PUBLIC_API
509void internal::Columns_detail<Column>::init(
510 const internal::Result_detail::Impl &impl
515 :
private internal::Columns_detail<Column>
519 using Columns_detail::operator[];
521 using Columns_detail::iterator;
523 using Columns_detail::begin;
524 using Columns_detail::end;
528 using Columns_detail::init;
533 Columns(Columns&&) =
default;
534 Columns& operator=(Columns&&) =
default;
537 friend internal::Row_result_detail<Columns>;
550bool Row_result_detail<Columns>::iterator_next();
553col_count_t Row_result_detail<Columns>::col_count()
const;
556Row_result_detail<Columns>::Row_result_detail(
557 common::Result_init &init
561auto Row_result_detail<Columns>::get_column(col_count_t pos)
const
565auto internal::Row_result_detail<Columns>::get_columns() const
569row_count_t internal::Row_result_detail<Columns>::row_count();
586 : public internal::Result_common<internal::Row_result_detail<Columns>>
590 using Columns = mysqlx::Columns;
592 RowResult() =
default;
597 col_count_t getColumnCount()
const
600 return Row_result_detail::col_count();
607 const Column& getColumn(col_count_t pos)
const
610 return Row_result_detail::get_column(pos);
621 const Columns& getColumns()
const
624 return Row_result_detail::get_columns();
638 return Row_result_detail::get_row();
654 return Row_result_detail::get_rows();
669 return Row_result_detail::row_count();
684 return Row_result_detail::begin();
692 return Row_result_detail::end();
700 RowResult(common::Result_init &init)
701 : Result_common(init)
706 template <
class Res,
class Op>
friend class Executable;
735 SqlResult() =
default;
747 return Result_detail::has_data();
765 return Row_result_detail::next_result();
776 uint64_t getAutoIncrementValue()
779 return Result_detail::get_auto_increment();
786 SqlResult(common::Result_init &init)
790 template <
class Res,
class Op>
791 friend class Executable;
816 :
public internal::Result_common<internal::Doc_result_detail>
821 DocResult() =
default;
832 return Doc_result_detail::get_doc();
848 return Doc_result_detail::get_docs();
863 return Doc_result_detail::count();
875 using iterator = Doc_result_detail::iterator;
880 return Doc_result_detail::begin();
888 return Doc_result_detail::end();
896 DocResult(common::Result_init &init)
897 : Result_common(init)
901 template <
class Res,
class Op>
902 friend class Executable;
Represents a collection of documents in a schema.
Definition: xdevapi.h:912
Provides meta-data for a single result column.
Definition: result.h:327
const CollationInfo & getCollation() const
< TODO
Definition: result.h:431
std::string getCharacterSetName() const
TODO.
Definition: result.h:423
string getSchemaName() const
< TODO
Definition: result.h:330
bool isPadded() const
TODO.
Definition: result.h:449
std::string getCollationName() const
TODO.
Definition: result.h:440
CharacterSet getCharacterSet() const
< TODO
Definition: result.h:414
Represents an operation that can be executed.
Definition: executable.h:68
Represents a result of an operation that does not return data.
Definition: result.h:184
DocIdList getGeneratedIds() const
Return a list of identifiers of multiple documents added to a collection, generated by the server.
Definition: result.h:208
uint64_t getAutoIncrementValue() const
Get the auto-increment value if one was generated by a table insert statement.
Definition: result.h:195
Details for public API result classes.
Declaration of DbDoc and related classes.
const char * characterSetName(CharacterSet id)
Returns name of a character set given by its id.
Definition: collations.h:71
const char * typeName(Type t)
Return name of a given type.
Definition: result.h:300
Type
Types that can be reported in result meta-data.
Definition: result.h:241
Structure that provides information about character set collation.
Definition: collations.h:94
const char * getName() const
String name of a collation, such as "latin1_generic_ci".
Definition: collations.h:101