1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/expression/bound_parameter_expression.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/planner/expression.hpp"
12#include "duckdb/planner/expression/bound_parameter_data.hpp"
13
14namespace duckdb {
15
16class BoundParameterExpression : public Expression {
17public:
18 static constexpr const ExpressionClass TYPE = ExpressionClass::BOUND_PARAMETER;
19
20public:
21 explicit BoundParameterExpression(idx_t parameter_nr);
22
23 idx_t parameter_nr;
24 shared_ptr<BoundParameterData> parameter_data;
25
26public:
27 //! Invalidate a bound parameter expression - forcing a rebind on any subsequent filters
28 DUCKDB_API static void Invalidate(Expression &expr);
29 //! Invalidate all parameters within an expression
30 DUCKDB_API static void InvalidateRecursive(Expression &expr);
31
32 bool IsScalar() const override;
33 bool HasParameter() const override;
34 bool IsFoldable() const override;
35
36 string ToString() const override;
37
38 bool Equals(const BaseExpression &other) const override;
39 hash_t Hash() const override;
40
41 unique_ptr<Expression> Copy() override;
42
43 void Serialize(FieldWriter &writer) const override;
44 static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
45};
46
47} // namespace duckdb
48