1 | //===----------------------------------------------------------------------===// |
---|---|
2 | // DuckDB |
3 | // |
4 | // duckdb/planner/column_binding.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/common/common.hpp" |
12 | #include "duckdb/common/to_string.hpp" |
13 | |
14 | #include <functional> |
15 | |
16 | namespace duckdb { |
17 | |
18 | struct ColumnBinding { |
19 | idx_t table_index; |
20 | // This index is local to a Binding, and has no meaning outside of the context of the Binding that created it |
21 | idx_t column_index; |
22 | |
23 | ColumnBinding() : table_index(DConstants::INVALID_INDEX), column_index(DConstants::INVALID_INDEX) { |
24 | } |
25 | ColumnBinding(idx_t table, idx_t column) : table_index(table), column_index(column) { |
26 | } |
27 | |
28 | string ToString() const { |
29 | return "#["+ to_string(val: table_index) + "."+ to_string(val: column_index) + "]"; |
30 | } |
31 | |
32 | bool operator==(const ColumnBinding &rhs) const { |
33 | return table_index == rhs.table_index && column_index == rhs.column_index; |
34 | } |
35 | }; |
36 | |
37 | } // namespace duckdb |
38 |