1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use crate::;
/// The binder — validates AST nodes against the catalog and produces
/// fully resolved bound nodes ready for the executor.
///
/// # Responsibilities
///
/// - Name resolution — confirms referenced objects exist in the catalog
/// - Default resolution — fills in omitted values (e.g. owner → session user)
/// - Semantic validation — catches errors that the parser cannot
/// (e.g. unknown role, invalid connection limit)
///
/// # What the binder does NOT do
///
/// - Modify the catalog — that is the executor's job
/// - Parse SQL — that is the parser's job
/// - Optimize — that is the planner's job
///
/// # Relationship to CatalogManager
///
/// The binder holds a shared read-only reference to the catalog.
/// Only the executor writes to the catalog via `CatalogManager`.