Skip to content

Commit c08ade4

Browse files
chore: query policies
1 parent 63e5bed commit c08ade4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

crates/pgt_schema_cache/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
mod columns;
66
mod functions;
7+
mod policies;
78
mod schema_cache;
89
mod schemas;
910
mod tables;

crates/pgt_schema_cache/src/schema_cache.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use sqlx::postgres::PgPool;
22

33
use crate::columns::Column;
44
use crate::functions::Function;
5+
use crate::policies::Policy;
56
use crate::schemas::Schema;
67
use crate::tables::Table;
78
use crate::types::PostgresType;
@@ -15,17 +16,19 @@ pub struct SchemaCache {
1516
pub types: Vec<PostgresType>,
1617
pub versions: Vec<Version>,
1718
pub columns: Vec<Column>,
19+
pub policies: Vec<Policy>,
1820
}
1921

2022
impl SchemaCache {
2123
pub async fn load(pool: &PgPool) -> Result<SchemaCache, sqlx::Error> {
22-
let (schemas, tables, functions, types, versions, columns) = futures_util::try_join!(
24+
let (schemas, tables, functions, types, versions, columns, policies) = futures_util::try_join!(
2325
Schema::load(pool),
2426
Table::load(pool),
2527
Function::load(pool),
2628
PostgresType::load(pool),
2729
Version::load(pool),
28-
Column::load(pool)
30+
Column::load(pool),
31+
Policy::load(pool),
2932
)?;
3033

3134
Ok(SchemaCache {
@@ -35,6 +38,7 @@ impl SchemaCache {
3538
types,
3639
versions,
3740
columns,
41+
policies,
3842
})
3943
}
4044

0 commit comments

Comments
 (0)