1#include "duckdb/planner/expression_binder/insert_binder.hpp"
2
3#include "duckdb/planner/expression/bound_default_expression.hpp"
4
5namespace duckdb {
6
7InsertBinder::InsertBinder(Binder &binder, ClientContext &context) : ExpressionBinder(binder, context) {
8}
9
10BindResult InsertBinder::BindExpression(unique_ptr<ParsedExpression> &expr_ptr, idx_t depth, bool root_expression) {
11 auto &expr = *expr_ptr;
12 switch (expr.GetExpressionClass()) {
13 case ExpressionClass::DEFAULT:
14 return BindResult("DEFAULT is not allowed here!");
15 case ExpressionClass::WINDOW:
16 return BindResult("INSERT statement cannot contain window functions!");
17 default:
18 return ExpressionBinder::BindExpression(expr_ptr, depth);
19 }
20}
21
22string InsertBinder::UnsupportedAggregateMessage() {
23 return "INSERT statement cannot contain aggregates!";
24}
25
26} // namespace duckdb
27