1#include "duckdb/execution/operator/schema/physical_create_schema.hpp"
2#include "duckdb/catalog/catalog.hpp"
3
4namespace duckdb {
5
6//===--------------------------------------------------------------------===//
7// Source
8//===--------------------------------------------------------------------===//
9SourceResultType PhysicalCreateSchema::GetData(ExecutionContext &context, DataChunk &chunk,
10 OperatorSourceInput &input) const {
11 auto &catalog = Catalog::GetCatalog(context&: context.client, catalog_name: info->catalog);
12 if (catalog.IsSystemCatalog()) {
13 throw BinderException("Cannot create schema in system catalog");
14 }
15 catalog.CreateSchema(context&: context.client, info&: *info);
16
17 return SourceResultType::FINISHED;
18}
19
20} // namespace duckdb
21