-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from project-tsurugi/metadata
implement metadata functionality
- Loading branch information
Showing
15 changed files
with
883 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2019-2025 Project Tsurugi. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include <jogasaki/proto/sql/response.pb.h> | ||
|
||
namespace ogawayama::stub { | ||
|
||
class search_path { | ||
public: | ||
/** | ||
* @brief returns a list of the schema name | ||
* @return a std::vector of the schema name | ||
*/ | ||
[[nodiscard]] virtual const std::vector<std::string>& get_schema_names() const = 0; | ||
|
||
search_path() = default; | ||
virtual ~search_path() = default; | ||
|
||
constexpr search_path(search_path const&) = delete; | ||
constexpr search_path(search_path&&) = delete; | ||
search_path& operator = (search_path const&) = delete; | ||
search_path& operator = (search_path&&) = delete; | ||
}; | ||
|
||
} // namespace ogawayama::stub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2019-2025 Project Tsurugi. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
#include <sstream> | ||
|
||
#include <jogasaki/proto/sql/response.pb.h> | ||
|
||
#include "search_path.h" | ||
|
||
namespace ogawayama::stub { | ||
|
||
class table_list { | ||
public: | ||
/** | ||
* @brief returns a list of the available table names in the database, except system tables | ||
* @return a list of the available table names | ||
*/ | ||
[[nodiscard]] virtual std::vector<std::string> get_table_names() const = 0; | ||
|
||
/** | ||
* @brief returns the schema name where the table defined | ||
* @param sp the search path | ||
* @return a std::vector of simple_names | ||
*/ | ||
[[nodiscard]] virtual std::vector<std::string> get_simple_names(search_path& sp) const = 0; | ||
|
||
table_list() = default; | ||
virtual ~table_list() = default; | ||
|
||
constexpr table_list(table_list const&) = delete; | ||
constexpr table_list(table_list&&) = delete; | ||
table_list& operator = (table_list const&) = delete; | ||
table_list& operator = (table_list&&) = delete; | ||
}; | ||
|
||
} // namespace ogawayama::stub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2019-2025 Project Tsurugi. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <optional> | ||
|
||
#include <jogasaki/proto/sql/response.pb.h> | ||
|
||
namespace ogawayama::stub { | ||
|
||
class table_metadata { | ||
public: | ||
/** | ||
* @brief returns the database name where the table defined | ||
* @return the database name, or empty if it is not set | ||
* @attention this method is not yet implemented | ||
*/ | ||
[[nodiscard]] virtual std::optional<std::string> database_name() const = 0; | ||
|
||
/** | ||
* @brief returns the schema name where the table defined | ||
* @return the schema name, or empty if it is not set | ||
* @attention this method is not yet implemented | ||
*/ | ||
[[nodiscard]] virtual std::optional<std::string> schema_name() const = 0; | ||
|
||
/** | ||
* @brief returns simple name of the table | ||
* @return the simple name | ||
*/ | ||
[[nodiscard]] virtual const std::string& table_name() const = 0; | ||
|
||
/** | ||
* @brief returns the column information of the relation | ||
* @return the column descriptor list | ||
*/ | ||
[[nodiscard]] virtual ::google::protobuf::RepeatedPtrField<jogasaki::proto::sql::common::Column> columns() const = 0; | ||
|
||
table_metadata() = default; | ||
virtual ~table_metadata() = default; | ||
|
||
constexpr table_metadata(table_metadata const&) = delete; | ||
constexpr table_metadata(table_metadata&&) = delete; | ||
table_metadata& operator = (table_metadata const&) = delete; | ||
table_metadata& operator = (table_metadata&&) = delete; | ||
}; | ||
|
||
} // namespace ogawayama::stub |
Oops, something went wrong.