risingwave_frontend/catalog/system_catalog/rw_catalog/
rw_secrets.rs1use risingwave_common::types::Fields;
16use risingwave_frontend_macro::system_catalog;
17
18use crate::catalog::system_catalog::SysCatalogReaderImpl;
19use crate::error::Result;
20
21#[derive(Fields)]
22struct RwSecret {
23 #[primary_key]
24 id: i32,
25 schema_id: i32,
26 name: String,
27 owner: i32,
28 acl: Vec<String>,
29}
30
31#[system_catalog(table, "rw_catalog.rw_secrets")]
32fn read_rw_view_info(reader: &SysCatalogReaderImpl) -> Result<Vec<RwSecret>> {
33 let catalog_reader = reader.catalog_reader.read_guard();
34 let schemas = catalog_reader.iter_schemas(&reader.auth_context.database)?;
35
36 Ok(schemas
37 .flat_map(|schema| {
38 schema.iter_secret().map(|secret| RwSecret {
39 id: secret.id.secret_id() as i32,
40 schema_id: secret.schema_id as i32,
41 name: secret.name.clone(),
42 owner: secret.owner as i32,
43 acl: vec![],
44 })
45 })
46 .collect())
47}