diff --git a/templates/config.yaml b/templates/config.yaml index 30fa1a3..2953276 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -154,6 +154,33 @@ data: shard = {{ .shard }} {{- end }} + {{- range .Values.shardedTables }} + [[sharded_tables]] + database = {{ .database | quote }} + {{- if .name }} + name = {{ .name | quote }} + {{- end }} + column = {{ .column | quote }} + data_type = {{ .dataType | quote }} + {{- end }} + + {{- range .Values.shardedMappings }} + [[sharded_mappings]] + database = {{ .database | quote }} + column = {{ .column | quote }} + kind = {{ .kind | quote }} + shard = {{ .shard }} + {{- if .values }} + values = {{ .values| toToml }} + {{- end }} + {{- if .start }} + start = {{ .start }} + {{- end }} + {{- if .end }} + end = {{ .end }} + {{- end}} + {{- end }} + {{- if or (hasKey .Values "tcpKeepalive") (hasKey .Values "tcpTime") (hasKey .Values "tcpInterval") (hasKey .Values "tcpRetries") }} [tcp] {{- if hasKey .Values "tcpKeepalives" }} diff --git a/values.yaml b/values.yaml index 50fdb3a..18045ef 100644 --- a/values.yaml +++ b/values.yaml @@ -112,6 +112,33 @@ mirrors: [] # shard: 0 shardedSchemas: [] +# shardedTables contains the list of sharded table entries in pgdog.toml +# Each entry requires: database, column and dataType; name is optional +# Example: +# shardedTables: +# - database: "prod" +# name: "users" +# column: "id" +# dataType: "bigint" +shardedTables: [] + +# shardedMappings contains the list of sharded mapping entries in pgdog.toml +# Each entry requires: database, column, kind, shard; values, start and end are optional +# Example: +# shardedMappings: +# - database: "prod" +# column: "tenant_id" +# kind: "list" +# values: [1, 5, 1_000] +# shard: 0 +# - database: "prod" +# column: "tenant_id" +# kind: "range" +# start: 1 +# end: 100 +# shard: 1 +shardedMappings: [] + # service contains the Kubernetes service configuration service: # type specifies the type of Kubernetes service