| 78 | } |
| 79 | |
| 80 | std::vector<PropertyDefinition> Binder::bindPropertyDefinitions( |
| 81 | const std::vector<ParsedPropertyDefinition>& parsedDefinitions, const std::string& tableName) { |
| 82 | std::vector<PropertyDefinition> definitions; |
| 83 | for (auto& def : parsedDefinitions) { |
| 84 | auto type = LogicalType::convertFromString(def.getType(), clientContext); |
| 85 | auto defaultExpr = |
| 86 | resolvePropertyDefault(def.defaultExpr.get(), type, tableName, def.getName()); |
| 87 | auto boundExpr = expressionBinder.bindExpression(*defaultExpr); |
| 88 | if (boundExpr->dataType != type) { |
| 89 | expressionBinder.implicitCast(boundExpr, type); |
| 90 | } |
| 91 | auto columnDefinition = ColumnDefinition(def.getName(), std::move(type)); |
| 92 | definitions.emplace_back(std::move(columnDefinition), std::move(defaultExpr)); |
| 93 | } |
| 94 | validatePropertyName(definitions); |
| 95 | return definitions; |
| 96 | } |
| 97 | |
| 98 | std::unique_ptr<ParsedExpression> Binder::resolvePropertyDefault(ParsedExpression* parsedDefault, |
| 99 | const LogicalType& type, const std::string& tableName, const std::string& propertyName) { |
nothing calls this directly
no test coverage detected