Skip to content

Commit

Permalink
schemachanger: support DB zone config
Browse files Browse the repository at this point in the history
This patch adds the functionality to configure
a zone configuration on a database.

Informs: cockroachdb#117574
Release note: None
  • Loading branch information
annrpom committed Jun 18, 2024
1 parent 7fe1452 commit f2ce69a
Show file tree
Hide file tree
Showing 20 changed files with 1,187 additions and 1 deletion.
56 changes: 56 additions & 0 deletions pkg/ccl/schemachangerccl/backup_base_generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pkg/sql/catalog/zone/zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ type OptionValue struct {
type ZoneConfigOption struct {
Field config.Field
RequiredType *types.T
Setter func(*zonepb.ZoneConfig, tree.Datum)
// Setter is used to set `Field` in the `zone config` to `datum`.
Setter func(*zonepb.ZoneConfig, tree.Datum)
// CheckAllowed, if not nil, is called to check if one is allowed to set this
// zone config field.
CheckAllowed func(context.Context, *cluster.Settings, tree.Datum) error
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ go_library(
"alter_table_drop_constraint.go",
"alter_table_validate_constraint.go",
"comment_on.go",
"configure_zone.go",
"create_database.go",
"create_function.go",
"create_index.go",
Expand All @@ -37,6 +38,7 @@ go_library(
deps = [
"//pkg/build",
"//pkg/clusterversion",
"//pkg/config/zonepb",
"//pkg/docs",
"//pkg/geo/geoindex",
"//pkg/keys",
Expand All @@ -56,6 +58,7 @@ go_library(
"//pkg/sql/catalog/seqexpr",
"//pkg/sql/catalog/tabledesc",
"//pkg/sql/catalog/typedesc",
"//pkg/sql/catalog/zone",
"//pkg/sql/decodeusername",
"//pkg/sql/paramparse",
"//pkg/sql/parser",
Expand All @@ -70,6 +73,7 @@ go_library(
"//pkg/sql/sem/catconstants",
"//pkg/sql/sem/catid",
"//pkg/sql/sem/eval",
"//pkg/sql/sem/transform",
"//pkg/sql/sem/tree",
"//pkg/sql/sem/volatility",
"//pkg/sql/sessiondata",
Expand Down
Loading

0 comments on commit f2ce69a

Please sign in to comment.