Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Commit a9e82cb

Browse files
committed
Add prefix-databases field
1 parent f50104e commit a9e82cb

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

docs/json_schemas/postgresql_client/v0/provider.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,22 @@
200200
"alphanum-32byte-random"
201201
],
202202
"title": "Entity password"
203+
},
204+
"prefix-databases": {
205+
"anyOf": [
206+
{
207+
"type": "string"
208+
},
209+
{
210+
"type": "null"
211+
}
212+
],
213+
"default": null,
214+
"description": "Comma separated list of databases matching a requested prefix",
215+
"examples": [
216+
"db1,db2"
217+
],
218+
"title": "Entity password"
203219
}
204220
},
205221
"required": [

interfaces/postgresql_client/v0/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ If any side, Provider or Requirer doesn't support Juju Secrets, sensitive inform
4444
- Is expected to express (via `external-node-connectivity`) whether external connectivity requests are to be respected or not, in case the charm is capable of such.
4545
- May require delays (via `subordinated`) to provide service on Requirer scale up. If so, it is expected to set unit level `state` data when it is `ready` to serve.
4646
- May respect the `entity-name` and `password` set in `requested-entity-secret`.
47+
- Is expected to populate `prefix-databases`, if a prefix was requested and any databases match the prefix.
4748

4849
### Requirer
4950

@@ -60,6 +61,7 @@ If any side, Provider or Requirer doesn't support Juju Secrets, sensitive inform
6061
- Is expected to respect the `subordinated` flag when scaling up and start emitting events only once unit level `state` is `ready`.
6162
- May require external connectivity (via `external-node-connectivity`).
6263
- May request specific entity credentials inside a secret set as `requested-entity-secret` field. Expected values in the secret are `entity-name` and an optional `password`. The requirer must be able to handle the requested values for `entity-name` and `password` not being respected.
64+
- May request a prefix in the `database` field, ending in `*` and containing at least three additional characters, for the provider to match.
6365

6466
## Relation Data
6567

interfaces/postgresql_client/v0/schema.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,14 @@ class PostgreSQLProviderData(BaseModel):
113113
title="Entity password",
114114
)
115115

116+
prefix_databases: Optional[str] = Field(
117+
None,
118+
alias="prefix-databases",
119+
description="Comma separated databases matching the requested prefix",
120+
examples=["database1,database2"],
121+
title="Prefix databases",
122+
)
123+
116124

117125
class PostgreSQLRequirerData(BaseModel):
118126
"""The databag for the requirer side of this interface."""

0 commit comments

Comments
 (0)