-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
Implement postgres auto-publish #546
Conversation
Codecov ReportBase: 58.47% // Head: 60.42% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #546 +/- ##
==========================================
+ Coverage 58.47% 60.42% +1.94%
==========================================
Files 23 23
Lines 1811 1933 +122
==========================================
+ Hits 1059 1168 +109
- Misses 752 765 +13
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
* NEW: support for maplibre#512 - pg table/function auto-discovery * can filter schemas * can use patterns like `{schema}.{table}.{column}` and `{schema}.{function}` * NEW: add `calc_bounds` bool flag to allow disabling of the bounds computation * reworked integration tests to use yaml
a32e8c8
to
faf2cf1
Compare
src/pg/config.rs
Outdated
|
||
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] | ||
pub struct PgCfgPublish { | ||
pub from_schema: Option<OneOrMany<String>>, |
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.
Should it be from_schemas
instead of from_schema
as in #512?
src/pg/configurator.rs
Outdated
Ok(Self { | ||
pool, | ||
default_srid: config.default_srid, | ||
auto_functions: config.auto_functions.clone().unwrap_or(Schemas::Bool(auto)), | ||
auto_tables: config.auto_tables.clone().unwrap_or(Schemas::Bool(auto)), | ||
calc_bounds: config.calc_bounds.unwrap_or(true), |
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.
We can name it disable_bounds
since this flag is intended to disable the default behavior (always expose bounds). We can also invert the default and use enable_bounds
.
@@ -169,6 +221,41 @@ impl PgBuilder { | |||
} | |||
} | |||
|
|||
fn new_auto_publish(config: &PgConfig, is_function: bool) -> Option<PgBuilderPublish> { |
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.
I'm okay to go with the notion that auto publish is true by default, as mentioned here #512 (comment)
But it still looks confusing and hard to reason about for me. We'd need to make this behavior clear in the docs.
{schema}.{table}.{column}
and{schema}.{function}
disable_bounds
bool flag to allow disabling of the bounds computation