pub fn parse_configuration(datamodel_string: &str) -> Result<ValidatedConfiguration, diagnostics::Diagnostics> {
    let mut warnings = Vec::new();
    let ast = ast::parser::parse_schema(datamodel_string)?;
    let mut validated_sources = load_sources(&ast, false, vec![])?;
    let mut validated_generators = GeneratorLoader::load_generators_from_ast(&ast)?;

    warnings.append(&mut validated_generators.warnings);
    warnings.append(&mut validated_sources.warnings);

    Ok(ValidatedConfiguration {
        subject: Configuration {
            datasources: validated_sources.subject,
            generators: validated_generators.subject,
        },
        warnings,
    })
}
/// Loads all configuration blocks from a datamodel using the built-in source definitions.
Loads all configuration blocks from a datamodel using the built-in source definitions.
Loads all configuration blocks from a datamodel using the built - in source definitions .
pub fn parse_configuration(datamodel_string: &str) -> Result<ValidatedConfiguration, diagnostics::Diagnostics> {
    let mut warnings = Vec::new();
    let ast = ast::parser::parse_schema(datamodel_string)?;
    let mut validated_sources = load_sources(&ast, false, vec![])?;
    let mut validated_generators = GeneratorLoader::load_generators_from_ast(&ast)?;
    warnings.append(&mut validated_generators.warnings);
    warnings.append(&mut validated_sources.warnings);
    Ok(ValidatedConfiguration {
        subject: Configuration {
            datasources: validated_sources.subject,
            generators: validated_generators.subject,
        },
        warnings,
    })
}
pub fn parse_configuration ( datamodel_string : & str ) -> Result < ValidatedConfiguration , diagnostics :: Diagnostics > { let mut warnings = Vec :: new ( ) ; let ast = ast :: parser :: parse_schema ( datamodel_string ) ? ; let mut validated_sources = load_sources ( & ast , false , vec ! [ ] ) ? ; let mut validated_generators = GeneratorLoader :: load_generators_from_ast ( & ast ) ? ; warnings . append ( & mut validated_generators . warnings ) ; warnings . append ( & mut validated_sources . warnings ) ; Ok ( ValidatedConfiguration { subject : Configuration { datasources : validated_sources . subject , generators : validated_generators . subject , } , warnings , } ) }
Loads all configuration blocks from a datamodel using the built-in source definitions.
Loads all configuration blocks from a datamodel using the built - in source definitions .
datamodel_string
&str
datamodel_string
&str