MySQL 9.3.0
Source Code Documentation
query_entry_object.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2023, 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,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License 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
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_DATABASE_QUERY_ENTRIES_OBJECT_H_
27#define ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_DATABASE_QUERY_ENTRIES_OBJECT_H_
28
29#include <map>
30#include <memory>
31#include <string>
32#include <tuple>
33#include <vector>
34
37
38namespace mrs {
39namespace database {
40
41class QueryEntryObject : protected Query {
42 public:
45
46 public:
47 virtual void query_entries(MySQLSession *session,
48 const std::string &schema_name,
49 const std::string &object_name,
50 const UniversalId &db_object_id) = 0;
51
52 std::shared_ptr<Object> object;
53};
54
55namespace v2 {
57 public:
58 void query_entries(MySQLSession *session, const std::string &schema_name,
59 const std::string &object_name,
60 const UniversalId &db_object_id) override;
61
62 protected:
63 virtual UniversalId query_object(MySQLSession *session,
64 const UniversalId &db_object_id,
65 Object *object);
66 virtual void set_query_object_reference(const entry::UniversalId &object_id);
67
68 void on_row(const ResultRow &r) override;
69
70 virtual void on_reference_row(const ResultRow &r);
71 virtual void on_field_row(const ResultRow &r);
72
74
75 std::map<entry::UniversalId, std::shared_ptr<entry::ForeignKeyReference>>
78};
79
80} // namespace v2
81
82namespace v3 {
83
85 private:
86 void on_reference_row(const ResultRow &r) override;
88 const UniversalId &db_object_id,
89 Object *object) override;
90 void set_query_object_reference(const entry::UniversalId &object_id) override;
91};
92
93} // namespace v3
94
95} // namespace database
96} // namespace mrs
97
98#endif // ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_DATABASE_QUERY_ENTRIES_OBJECT_H_
Definition: query_entry_object.h:41
entry::UniversalId UniversalId
Definition: query_entry_object.h:44
entry::Object Object
Definition: query_entry_object.h:43
std::shared_ptr< Object > object
Definition: query_entry_object.h:52
virtual void query_entries(MySQLSession *session, const std::string &schema_name, const std::string &object_name, const UniversalId &db_object_id)=0
Definition: query.h:37
Definition: query_entry_object.h:56
std::map< entry::UniversalId, std::shared_ptr< entry::ForeignKeyReference > > m_references
Definition: query_entry_object.h:76
int m_alias_count
Definition: query_entry_object.h:77
void on_row(const ResultRow &r) override
Definition: query_entries_object.cc:229
void query_entries(MySQLSession *session, const std::string &schema_name, const std::string &object_name, const UniversalId &db_object_id) override
Definition: query_entries_object.cc:138
virtual void on_field_row(const ResultRow &r)
Definition: query_entries_object.cc:270
virtual void set_query_object_reference(const entry::UniversalId &object_id)
Definition: query_entries_object.cc:210
virtual UniversalId query_object(MySQLSession *session, const UniversalId &db_object_id, Object *object)
Definition: query_entries_object.cc:103
virtual void on_reference_row(const ResultRow &r)
Definition: query_entries_object.cc:248
bool m_loading_references
Definition: query_entry_object.h:73
Definition: query_entry_object.h:84
void on_reference_row(const ResultRow &r) override
Definition: query_entries_object.cc:471
UniversalId query_object(MySQLSession *session, const UniversalId &db_object_id, Object *object) override
Definition: query_entries_object.cc:395
void set_query_object_reference(const entry::UniversalId &object_id) override
Definition: query_entries_object.cc:444
Definition: mysql_session.h:310
Definition: mysql_session.h:157
MysqlCacheManager::Object Object
Definition: mysql_cache_manager.cc:101
Definition: authorize_manager.h:48
mrs::database::entry::UniversalId UniversalId
Definition: universal_id.h:33
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86