Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }}
Expand Down
27 changes: 27 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down