1#include "duckdb/parser/tableref/basetableref.hpp"
2
3#include "duckdb/common/serializer.hpp"
4
5using namespace duckdb;
6using namespace std;
7
8bool BaseTableRef::Equals(const TableRef *other_) const {
9 if (!TableRef::Equals(other_)) {
10 return false;
11 }
12 auto other = (BaseTableRef *)other_;
13 return other->schema_name == schema_name && other->table_name == table_name;
14}
15
16void BaseTableRef::Serialize(Serializer &serializer) {
17 TableRef::Serialize(serializer);
18
19 serializer.WriteString(schema_name);
20 serializer.WriteString(table_name);
21}
22
23unique_ptr<TableRef> BaseTableRef::Deserialize(Deserializer &source) {
24 auto result = make_unique<BaseTableRef>();
25
26 result->schema_name = source.Read<string>();
27 result->table_name = source.Read<string>();
28
29 return move(result);
30}
31
32unique_ptr<TableRef> BaseTableRef::Copy() {
33 auto copy = make_unique<BaseTableRef>();
34
35 copy->schema_name = schema_name;
36 copy->table_name = table_name;
37 copy->alias = alias;
38
39 return move(copy);
40}
41