-
Notifications
You must be signed in to change notification settings - Fork 102
adds postgres version to the schema cache. #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds postgres version to the schema cache. #141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Just one minor note 🙏🏼
) AS active_connections, | ||
current_setting('max_connections') :: int8 AS max_connections;"# | ||
) | ||
.fetch_all(pool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just one row?
|
||
#[derive(Debug, Clone, Default)] | ||
pub struct SchemaCache { | ||
pub schemas: Vec<Schema>, | ||
pub tables: Vec<Table>, | ||
pub functions: Vec<Function>, | ||
pub types: Vec<PostgresType>, | ||
pub versions: Vec<Version>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to have a Vec instead of a single struct?
Hey @psteinroe , thanks for the reply. While it does make sense to have a single type instead of a Vec, the pub trait SchemaCacheItem {
type Item;
async fn load(pool: &PgPool) -> Vec<Self::Item>;
} is defined as having a |
Ah yeah I think it makes sense to refactor this a bit. Do you want to do it in your pr or should we merge and do a follow-up? 🙏🏼 |
Let's do a follow up. I'm not sure how the refactoring will look like at the moment. |
sounds good! the ci is failing due to an unrelated issue. I am going to fix it soon and then merge 🙏🏼 |
Adds the postgres version in the schema cache using SQL from the
pg-meta
library.