Struct psl::Configuration
source · pub struct Configuration {
pub generators: Vec<Generator>,
pub datasources: Vec<Datasource>,
pub warnings: Vec<DatamodelWarning>,
}
Fields§
§generators: Vec<Generator>
§datasources: Vec<Datasource>
§warnings: Vec<DatamodelWarning>
Implementations§
source§impl Configuration
impl Configuration
pub fn validate_that_one_datasource_is_provided( &self ) -> Result<(), Diagnostics>
pub fn relation_mode(&self) -> Option<RelationMode>
pub fn max_identifier_length(&self) -> usize
pub fn preview_features(&self) -> BitFlags<PreviewFeature>
sourcepub fn resolve_datasource_urls_query_engine<F>(
&mut self,
url_overrides: &[(String, String)],
env: F,
ignore_env_errors: bool
) -> Result<(), Diagnostics>where
F: Fn(&str) -> Option<String> + Copy,
pub fn resolve_datasource_urls_query_engine<F>( &mut self, url_overrides: &[(String, String)], env: F, ignore_env_errors: bool ) -> Result<(), Diagnostics>where F: Fn(&str) -> Option<String> + Copy,
Resolve datasource url for query engine.
The main interesting thing here is we want to ignore any error that may arise from resolving direct_url.
sourcepub fn resolve_datasource_urls_prisma_fmt<F>(
&mut self,
url_overrides: &[(String, String)],
env: F
) -> Result<(), Diagnostics>where
F: Fn(&str) -> Option<String> + Copy,
pub fn resolve_datasource_urls_prisma_fmt<F>( &mut self, url_overrides: &[(String, String)], env: F ) -> Result<(), Diagnostics>where F: Fn(&str) -> Option<String> + Copy,
Resolve datasource URL’s for getConfig. The main reason this exists is:
- we want to error if we can’t resolve direct_url
- we want to skip validation for url IF we have a direct_url
For that last bit, we only do this currently because our validation errors on URL’s starting with ‘prisma://’. We would ideally like to do the other validations and ignore in this case.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl !UnwindSafe for Configuration
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more