Skip to content
Draft
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
112 changes: 112 additions & 0 deletions .schema/pgdog.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@
"ban_timeout": 300000,
"broadcast_address": null,
"broadcast_port": 6433,
"cache": {
"backend": "redis",
"enabled": false,
"max_result_size": 0,
"policy": "no_cache",
"redis": {
"cache_key_prefix": "pgdog:",
"url": "redis://localhost:6379"
},
"ttl": 300
},
"checkout_timeout": 5000,
"client_connection_recovery": "drop",
"client_idle_in_transaction_timeout": 9223372036854775807,
Expand Down Expand Up @@ -275,6 +286,75 @@
}
]
},
"Cache": {
"description": "Cache configuration.",
"type": "object",
"properties": {
"backend": {
"description": "Which storage backend to use.\n\n_Default:_ `redis`",
"$ref": "#/$defs/CacheBackend",
"default": "redis"
},
"enabled": {
"description": "Whether to enable caching.\n\n_Default:_ `false`",
"type": "boolean",
"default": false
},
"max_result_size": {
"description": "Maximum result size in bytes to cache (0 = unlimited).\n\n_Default:_ `0`",
"type": "integer",
"format": "uint",
"default": 0,
"minimum": 0
},
"policy": {
"description": "Cache policy: `no_cache` or `cache`.\n\n_Default:_ `no_cache`",
"$ref": "#/$defs/CachePolicy",
"default": "no_cache"
},
"redis": {
"description": "Redis backend configuration.\n\nOnly read when `backend = \"redis\"`.",
"$ref": "#/$defs/RedisConfig",
"default": {
"cache_key_prefix": "pgdog:",
"url": "redis://localhost:6379"
}
},
"ttl": {
"description": "Default TTL in seconds for cached queries.\n\n_Default:_ `300`",
"type": "integer",
"format": "uint64",
"default": 300,
"minimum": 0
}
},
"additionalProperties": false
},
"CacheBackend": {
"description": "Cache storage backend discriminator.",
"oneOf": [
{
"description": "Redis backend (default).",
"type": "string",
"const": "redis"
}
]
},
"CachePolicy": {
"description": "Cache policy.",
"oneOf": [
{
"description": "Never cache queries for this database.",
"type": "string",
"const": "no_cache"
},
{
"description": "Always cache read queries.",
"type": "string",
"const": "cache"
}
]
},
"ConnectionRecovery": {
"description": "controls if server connections are recovered or dropped if a client abruptly disconnects.\n\nhttps://docs.pgdog.dev/configuration/pgdog.toml/general/#connection_recovery",
"oneOf": [
Expand Down Expand Up @@ -574,6 +654,21 @@
"maximum": 65535,
"minimum": 0
},
"cache": {
"description": "Redis cache configuration for this database.",
"$ref": "#/$defs/Cache",
"default": {
"backend": "redis",
"enabled": false,
"max_result_size": 0,
"policy": "no_cache",
"redis": {
"cache_key_prefix": "pgdog:",
"url": "redis://localhost:6379"
},
"ttl": 300
}
},
"checkout_timeout": {
"description": "Maximum amount of time a client is allowed to wait for a connection from the pool.\n\n_Default:_ `5000`\n\nhttps://docs.pgdog.dev/configuration/pgdog.toml/general/#checkout_timeout",
"type": "integer",
Expand Down Expand Up @@ -1441,6 +1536,23 @@
}
]
},
"RedisConfig": {
"description": "Redis-specific cache backend configuration.\n\nCorresponds to the `[general.cache.redis]` TOML section.",
"type": "object",
"properties": {
"cache_key_prefix": {
"description": "Key prefix prepended to every cache key stored in Redis.\n\n_Default:_ `pgdog:`",
"type": "string",
"default": "pgdog:"
},
"url": {
"description": "Redis connection URL.\n\n_Default:_ `redis://localhost:6379`",
"type": "string",
"default": "redis://localhost:6379"
}
},
"additionalProperties": false
},
"ReplicaLag": {
"description": "Replica lag banning configuration. When a replica's replication lag exceeds the threshold, it is banned from serving read queries.",
"type": "object",
Expand Down
99 changes: 98 additions & 1 deletion Cargo.lock

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

Loading