Unify backend resources and role bindings in clusters

This commit is contained in:
2026-11-30 18:24:24 +08:00
parent ac62c8a655
commit 9869a9966c
18 changed files with 469 additions and 227 deletions
+35
View File
@@ -0,0 +1,35 @@
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ConfigError {
#[error("invalid {0} name")]
Name(&'static str),
#[error("the selected database cluster is not configured")]
UnknownCluster,
#[error("a cluster must be selected when clusters are configured")]
ClusterRequired,
#[error("legacy cluster and sql.documents refer to different resources")]
ConflictingDocuments,
#[error("binding {role} references unknown resource {target}")]
UnknownBinding { role: String, target: String },
#[error("conflicting bindings for role {0}")]
ConflictingBinding(String),
#[error("invalid object storage configuration")]
ObjectStorage,
#[error("resource already exists")]
DuplicateResource,
#[error("resource does not exist")]
MissingResource,
#[error("resource is referenced by a deployment binding")]
ResourceInUse,
#[error("a resource update must preserve its category")]
ResourceCategory,
#[error("the database pool size must be greater than zero")]
PoolSize,
#[error("SQLite does not support a replica list")]
SqliteReplicas,
#[error("invalid SQLite file path")]
SqlitePath,
#[error("invalid {0} database URL")]
Url(&'static str),
}