Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
adbbc8e
add flake
nutsalhan87 May 13, 2026
0b90713
redis cache mvp
nutsalhan87 May 13, 2026
98eff6f
updated cache docs
nutsalhan87 May 13, 2026
a7112ff
update key hashing algorithm
nutsalhan87 May 13, 2026
093e7ba
avoid caching error responses
nutsalhan87 May 13, 2026
eb977ed
fixed setting pgdog.cache via DSN options
nutsalhan87 May 13, 2026
7a6d81d
changed cache scope from connection to global
nutsalhan87 May 13, 2026
b44783d
reexport cache config
nutsalhan87 May 13, 2026
a71ec7c
Use built-in query comment hints
nutsalhan87 May 13, 2026
9d682c6
updated cache config
nutsalhan87 May 13, 2026
44ae0ed
force-cache hint support
nutsalhan87 May 13, 2026
efa318d
return comment
nutsalhan87 May 13, 2026
1aceafc
remove unescaping on pgdog's side
nutsalhan87 May 13, 2026
bd4a264
remove auto policy and stats tracker
nutsalhan87 May 13, 2026
8d5cf1b
bring doc to current state
nutsalhan87 May 13, 2026
48d67be
cache processing and client responding refined
nutsalhan87 May 14, 2026
6e08a25
added support for multiple backends and provided config hotswap for c…
nutsalhan87 May 15, 2026
4c77176
deleted files that not belong to the feature:
nutsalhan87 May 18, 2026
d94fdea
prepared statement's result caching
nutsalhan87 May 18, 2026
1bc4585
fmt and clippy
nutsalhan87 May 18, 2026
2d9c605
add unit tests
nutsalhan87 May 20, 2026
3e6e76f
strip sql comments while hashing
nutsalhan87 May 21, 2026
15bbd9a
add integratoin tests
nutsalhan87 May 25, 2026
df3af8c
fmt
nutsalhan87 Jun 1, 2026
634830c
rewrite integration tests to python
nutsalhan87 Jun 1, 2026
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