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