-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathmysql_table_entry.hpp
52 lines (40 loc) · 1.61 KB
/
mysql_table_entry.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//===----------------------------------------------------------------------===//
// DuckDB
//
// storage/mysql_table_entry.hpp
//
//
//===----------------------------------------------------------------------===//
#pragma once
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
#include "duckdb/parser/parsed_data/create_table_info.hpp"
#include "mysql_filter_pushdown.hpp"
#include "mysql_utils.hpp"
namespace duckdb {
struct MySQLTableInfo {
MySQLTableInfo() {
create_info = make_uniq<CreateTableInfo>();
}
MySQLTableInfo(const string &schema, const string &table) {
create_info = make_uniq<CreateTableInfo>(string(), schema, table);
}
MySQLTableInfo(const SchemaCatalogEntry &schema, const string &table) {
create_info = make_uniq<CreateTableInfo>((SchemaCatalogEntry &)schema, table);
}
const string &GetTableName() const {
return create_info->table;
}
unique_ptr<CreateTableInfo> create_info;
};
class MySQLTableEntry : public TableCatalogEntry {
public:
MySQLTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateTableInfo &info);
MySQLTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, MySQLTableInfo &info);
public:
unique_ptr<BaseStatistics> GetStatistics(ClientContext &context, column_t column_id) override;
TableFunction GetScanFunction(ClientContext &context, unique_ptr<FunctionData> &bind_data) override;
TableStorageInfo GetStorageInfo(ClientContext &context) override;
void BindUpdateConstraints(LogicalGet &get, LogicalProjection &proj, LogicalUpdate &update,
ClientContext &context) override;
};
} // namespace duckdb