1#include "duckdb/parser/expression/table_star_expression.hpp"
2#include "duckdb/common/serializer.hpp"
3
4using namespace duckdb;
5using namespace std;
6
7TableStarExpression::TableStarExpression(string relation_name)
8 : ParsedExpression(ExpressionType::TABLE_STAR, ExpressionClass::TABLE_STAR), relation_name(relation_name) {
9}
10
11string TableStarExpression::ToString() const {
12 return relation_name + ".*";
13}
14
15bool TableStarExpression::Equals(const TableStarExpression *a, const TableStarExpression *b) {
16 return a->relation_name == b->relation_name;
17}
18
19unique_ptr<ParsedExpression> TableStarExpression::Copy() const {
20 auto copy = make_unique<TableStarExpression>(relation_name);
21 copy->CopyProperties(*this);
22 return move(copy);
23}
24
25void TableStarExpression::Serialize(Serializer &serializer) {
26 ParsedExpression::Serialize(serializer);
27 serializer.WriteString(relation_name);
28}
29
30unique_ptr<ParsedExpression> TableStarExpression::Deserialize(ExpressionType type, Deserializer &source) {
31 return make_unique<TableStarExpression>(source.Read<string>());
32}
33