risingwave_frontend/catalog/system_catalog/rw_catalog/
rw_relations.rs1use risingwave_common::id::UserId;
16use risingwave_common::types::Fields;
17use risingwave_frontend_macro::system_catalog;
18
19#[system_catalog(
21 view,
22 "rw_catalog.rw_relations",
23 "SELECT id, name, 'table' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_tables
24 UNION ALL SELECT id, name, 'system table' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_system_tables
25 UNION ALL SELECT id, name, 'source' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_sources
26 UNION ALL SELECT id, name, 'index' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_indexes
27 UNION ALL SELECT id, name, 'sink' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_sinks
28 UNION ALL SELECT id, name, 'subscription' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_subscriptions
29 UNION ALL SELECT id, name, 'materialized view' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_materialized_views
30 UNION ALL SELECT id, name, 'view' AS relation_type, schema_id, owner, definition, acl FROM rw_catalog.rw_views
31 "
32)]
33#[derive(Fields)]
34struct RwRelation {
35 id: i32,
36 name: String,
37 relation_type: String,
38 schema_id: i32,
39 owner: UserId,
40 definition: String,
41 acl: Vec<String>,
42}