1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/parser/tableref/basetableref.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/parser/tableref.hpp"
12#include "duckdb/common/vector.hpp"
13
14namespace duckdb {
15//! Represents a TableReference to a base table in the schema
16class BaseTableRef : public TableRef {
17public:
18 static constexpr const TableReferenceType TYPE = TableReferenceType::BASE_TABLE;
19
20public:
21 BaseTableRef()
22 : TableRef(TableReferenceType::BASE_TABLE), catalog_name(INVALID_CATALOG), schema_name(INVALID_SCHEMA) {
23 }
24
25 //! The catalog name
26 string catalog_name;
27 //! Schema name
28 string schema_name;
29 //! Table name
30 string table_name;
31 //! Aliases for the column names
32 vector<string> column_name_alias;
33
34public:
35 string ToString() const override;
36 bool Equals(const TableRef &other_p) const override;
37
38 unique_ptr<TableRef> Copy() override;
39
40 //! Serializes a blob into a BaseTableRef
41 void Serialize(FieldWriter &serializer) const override;
42 //! Deserializes a blob back into a BaseTableRef
43 static unique_ptr<TableRef> Deserialize(FieldReader &source);
44
45 void FormatSerialize(FormatSerializer &serializer) const override;
46
47 static unique_ptr<TableRef> FormatDeserialize(FormatDeserializer &source);
48};
49} // namespace duckdb
50