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

source

pub fn validate_that_one_datasource_is_provided( &self ) -> Result<(), Diagnostics>

source

pub fn relation_mode(&self) -> Option<RelationMode>

source

pub fn max_identifier_length(&self) -> usize

source

pub fn preview_features(&self) -> BitFlags<PreviewFeature>

source

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.

source

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§

source§

impl Debug for Configuration

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.