(&self, table_id: TableId)
| 43 | } |
| 44 | |
| 45 | fn rls_rules_for_table(&self, table_id: TableId) -> anyhow::Result<Vec<Box<str>>> { |
| 46 | self.tx |
| 47 | .iter_by_col_eq( |
| 48 | ST_ROW_LEVEL_SECURITY_ID, |
| 49 | StRowLevelSecurityFields::TableId, |
| 50 | &AlgebraicValue::from(table_id), |
| 51 | )? |
| 52 | .map(|row| { |
| 53 | row.read_col::<AlgebraicValue>(StRowLevelSecurityFields::Sql) |
| 54 | .with_context(|| { |
| 55 | format!( |
| 56 | "Failed to read value from the `{}` column of `{}` for table_id `{}`", |
| 57 | "sql", "st_row_level_security", table_id |
| 58 | ) |
| 59 | }) |
| 60 | .and_then(|sql| { |
| 61 | sql.into_string().map_err(|_| { |
| 62 | anyhow::anyhow!(format!( |
| 63 | "Failed to read value from the `{}` column of `{}` for table_id `{}`", |
| 64 | "sql", "st_row_level_security", table_id |
| 65 | )) |
| 66 | }) |
| 67 | }) |
| 68 | }) |
| 69 | .collect::<anyhow::Result<_>>() |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | impl<'a, T> SchemaViewer<'a, T> { |
nothing calls this directly
no test coverage detected