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
4 changes: 3 additions & 1 deletion templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ data:
name = {{ .name | quote }}
{{- end }}
column = {{ .column | quote }}
data_type = {{ .dataType | quote }}
{{- with .dataType }}
data_type = {{ . | quote }}
{{- end }}
{{- range .mapping }}
[[sharded_tables.mapping]]
{{- if hasKey . "values" }}
Expand Down
19 changes: 19 additions & 0 deletions test/values-sharded-default-type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
databases:
- name: prod
host: shard-0
shard: 0
- name: prod
host: shard-1
shard: 1
users:
- name: postgres
database: prod
password: test
shardedTables:
- database: prod
name: tenants
column: tenant_id
- database: prod
name: events
column: event_id
dataType: uuid
3 changes: 2 additions & 1 deletion values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ queryParsers: []
shardedSchemas: []

# shardedTables contains the list of sharded table entries in pgdog.toml
# Each entry requires: database, column and dataType; name is optional
# Each entry requires: database and column; name and dataType are optional.
# When dataType is omitted, PgDog defaults to bigint.
# An entry may also carry a list/range/default mapping via the optional `mapping` field.
# Each mapping rule has a target `shard`; the rule type is inferred from the fields set:
# - `values` -> list rule
Expand Down
Loading