MySQL 9.3.0
Source Code Documentation
polyglot_column.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025, Oracle and/or its affiliates.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2.0,
6 * as published by the Free Software Foundation.
7 *
8 * This program is designed to work with certain software (including
9 * but not limited to OpenSSL) that is licensed under separate terms,
10 * as designated in a particular file or component or in included license
11 * documentation. The authors of MySQL hereby grant you an additional
12 * permission to link the program and your derivative works with the
13 * separately licensed software that they have either included with
14 * the program or referenced in the documentation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
19 * the GNU General Public License, version 2.0, for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#ifndef ROUTER_SRC_JIT_EXECUTOR_SRC_OBJECTS_POLYGLOT_COLUMN_H_
27#define ROUTER_SRC_JIT_EXECUTOR_SRC_OBJECTS_POLYGLOT_COLUMN_H_
28
29#include <memory>
30#include <string>
31
35
36namespace shcore {
37namespace polyglot {
38
39class Column : public Object_bridge {
40 public:
41 Column(const std::shared_ptr<jit_executor::db::IColumn> &meta,
42 const shcore::Value &type);
43
44 std::string class_name() const override { return "Column"; }
45
47 shcore::Value get_member(const std::string &prop) const override;
48
49 const std::string &get_schema_name() const { return m_column->get_schema(); }
50
51 const std::string &get_table_name() const {
52 return m_column->get_table_name();
53 }
54
55 const std::string &get_table_label() const {
56 return m_column->get_table_label();
57 }
58
59 const std::string &get_column_name() const {
60 return m_column->get_column_name();
61 }
62
63 const std::string &get_column_label() const {
64 return m_column->get_column_label();
65 }
66
67 shcore::Value get_type() const { return m_type; }
68
69 uint32_t get_length() const { return m_column->get_length(); }
70
71 int get_fractional_digits() const { return m_column->get_fractional(); }
72
73 bool is_number_signed() const {
74 return m_column->is_numeric() ? !m_column->is_unsigned() : false;
75 }
76
77 // std::string get_collation_name() const { return
78 // m_column->get_collation_name(); }
79
80 // std::string get_character_set_name() const { return
81 // m_column->get_charset_name(); }
82
83 bool is_zerofill() const { return m_column->is_zerofill(); }
84
85 std::string get_flags() const { return m_column->get_flags(); }
86
87 bool is_binary() const { return m_column->is_binary(); }
88 bool is_numeric() const { return m_column->is_numeric(); }
89
90 private:
91 std::vector<std::string> *properties() const override {
92 return &m_properties;
93 }
94
95 static std::vector<std::string> m_properties;
96 std::shared_ptr<jit_executor::db::IColumn> m_column;
98};
99
100} // namespace polyglot
101} // namespace shcore
102
103#endif // ROUTER_SRC_JIT_EXECUTOR_SRC_OBJECTS_POLYGLOT_COLUMN_H_
Definition: polyglot_column.h:39
std::string get_flags() const
Definition: polyglot_column.h:85
const std::string & get_column_label() const
Definition: polyglot_column.h:63
std::string class_name() const override
Definition: polyglot_column.h:44
std::shared_ptr< jit_executor::db::IColumn > m_column
Definition: polyglot_column.h:96
bool is_number_signed() const
Definition: polyglot_column.h:73
const std::string & get_schema_name() const
Definition: polyglot_column.h:49
bool is_zerofill() const
Definition: polyglot_column.h:83
bool is_numeric() const
Definition: polyglot_column.h:88
shcore::Value m_type
Definition: polyglot_column.h:97
static std::vector< std::string > m_properties
Definition: polyglot_column.h:95
shcore::Value get_member(const std::string &prop) const override
Returns the value of a member.
Definition: polyglot_column.cc:63
std::vector< std::string > * properties() const override
Definition: polyglot_column.h:91
bool is_binary() const
Definition: polyglot_column.h:87
uint32_t get_length() const
Definition: polyglot_column.h:69
const std::string & get_table_label() const
Definition: polyglot_column.h:55
int get_fractional_digits() const
Definition: polyglot_column.h:71
Column(const std::shared_ptr< jit_executor::db::IColumn > &meta, const shcore::Value &type)
Definition: polyglot_column.cc:59
shcore::Value get_type() const
Definition: polyglot_column.h:67
const std::string & get_table_name() const
Definition: polyglot_column.h:51
const std::string & get_column_name() const
Definition: polyglot_column.h:59
Definition: polyglot_object_bridge.h:38
virtual Value get_member(size_t) const
Returns the value of a member.
Definition: polyglot_object_bridge.h:64
Definition: file_system_exceptions.h:34
required string type
Definition: replication_group_member_actions.proto:34
Pointer to a function that may be implemented in any language.
Definition: jit_executor_value.h:130