MySQL 9.3.0
Source Code Documentation
query_rest_table_single_row.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2021, 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_REST_MRS_SRC_MRS_DATABASE_REST_FETCH_ONE_H_
27#define ROUTER_SRC_REST_MRS_SRC_MRS_DATABASE_REST_FETCH_ONE_H_
28
29#include <memory>
30#include <set>
31#include <string>
32#include <vector>
33
34#include "helper/mysql_column.h"
37
38namespace mrs {
39namespace database {
40
42 public:
47
48 public:
50 const JsonTemplateFactory *factory = nullptr,
51 bool encode_bigints_as_string = false, const bool include_links = true,
52 const RowLockType lock_rows = RowLockType::NONE,
53 uint64_t max_execution_time_ms = 0);
54
55 virtual void query_entry(MySQLSession *session,
56 std::shared_ptr<database::entry::Object> object,
57 const PrimaryKeyColumnValues &pk,
58 const dv::ObjectFieldFilter &field_filter,
59 const std::string &url_route,
60 const ObjectRowOwnership &row_ownership,
61 const FilterObjectGenerator &fog = {},
62 const bool compute_etag = false,
63 const std::string &metadata_gtid = {},
64 const bool fetch_any_owner = false);
65
66 bool is_owned() const { return is_owned_; }
67
68 private:
69 std::string metadata_gtid_{};
70 bool is_owned_ = true;
72
73 void on_row(const ResultRow &r) override;
74 void build_query(const dv::ObjectFieldFilter &field_filter,
75 const std::string &url_route,
76 const ObjectRowOwnership &row_ownership,
77 const PrimaryKeyColumnValues &pk, bool fetch_any_owner,
78 const FilterObjectGenerator &fog);
79};
80
81} // namespace database
82} // namespace mrs
83
84#endif // ROUTER_SRC_REST_MRS_SRC_MRS_DATABASE_REST_FETCH_ONE_H_
Definition: filter_object_generator.h:44
Definition: json_template.h:85
Definition: object_row_ownership.h:45
Definition: query_rest_table_single_row.h:41
std::string metadata_gtid_
Definition: query_rest_table_single_row.h:69
bool is_owned_
Definition: query_rest_table_single_row.h:70
mrs::database::PrimaryKeyColumnValues PrimaryKeyColumnValues
Definition: query_rest_table_single_row.h:45
RowLockType lock_rows_
Definition: query_rest_table_single_row.h:71
bool is_owned() const
Definition: query_rest_table_single_row.h:66
virtual void query_entry(MySQLSession *session, std::shared_ptr< database::entry::Object > object, const PrimaryKeyColumnValues &pk, const dv::ObjectFieldFilter &field_filter, const std::string &url_route, const ObjectRowOwnership &row_ownership, const FilterObjectGenerator &fog={}, const bool compute_etag=false, const std::string &metadata_gtid={}, const bool fetch_any_owner=false)
Definition: query_rest_table_single_row.cc:44
void on_row(const ResultRow &r) override
Definition: query_rest_table_single_row.cc:72
QueryRestTableSingleRow(const JsonTemplateFactory *factory=nullptr, bool encode_bigints_as_string=false, const bool include_links=true, const RowLockType lock_rows=RowLockType::NONE, uint64_t max_execution_time_ms=0)
Definition: query_rest_table_single_row.cc:36
void build_query(const dv::ObjectFieldFilter &field_filter, const std::string &url_route, const ObjectRowOwnership &row_ownership, const PrimaryKeyColumnValues &pk, bool fetch_any_owner, const FilterObjectGenerator &fog)
Definition: query_rest_table_single_row.cc:90
Definition: query_rest_table.h:47
entry::Object Object
Definition: query_rest_table.h:49
entry::ObjectField ObjectField
Definition: query_rest_table.h:50
Definition: mysql_session.h:310
Definition: mysql_session.h:157
MysqlCacheManager::Object Object
Definition: mysql_cache_manager.cc:101
database::entry::ObjectField ObjectField
Definition: sp_function_query.cc:51
RowLockType
Definition: select.h:47
std::map< std::string, mysqlrouter::sqlstring > PrimaryKeyColumnValues
Definition: select.h:43
Definition: authorize_manager.h:48
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86