pub fn load_datasources_from_ast(
        &self,
        ast_schema: &ast::SchemaAst,
        preview_features: &HashSet<&PreviewFeature>,
        diagnostics: &mut Diagnostics,
    ) -> Vec<Datasource> {
        let mut sources = Vec::new();

        for src in ast_schema.sources() {
            if let Some(source) = self.lift_datasource(&src, preview_features, diagnostics) {
                sources.push(source)
            }
        }

        if sources.len() > 1 {
            for src in ast_schema.sources() {
                diagnostics.push_error(DatamodelError::new_source_validation_error(
                    &"You defined more than one datasource. This is not allowed yet because support for multiple databases has not been implemented yet.".to_string(),
                    &src.name.name,
                    src.span,
                ));
            }
        }

        sources
    }
/// Loads all datasources from the provided schema AST.
/// - `ignore_datasource_urls`: datasource URLs are not parsed. They are replaced with dummy values.
/// - `datasource_url_overrides`: datasource URLs are not parsed and overridden with the provided ones.
Loads all datasources from the provided schema AST.
Loads all datasources from the provided schema AST .
pub fn load_datasources_from_ast(
        &self,
        ast_schema: &ast::SchemaAst,
        preview_features: &HashSet<&PreviewFeature>,
        diagnostics: &mut Diagnostics,
    ) -> Vec<Datasource> {
        let mut sources = Vec::new();
        for src in ast_schema.sources() {
            if let Some(source) = self.lift_datasource(&src, preview_features, diagnostics) {
                sources.push(source)
            }
        }
        if sources.len() > 1 {
            for src in ast_schema.sources() {
                diagnostics.push_error(DatamodelError::new_source_validation_error(
                    &"You defined more than one datasource. This is not allowed yet because support for multiple databases has not been implemented yet.".to_string(),
                    &src.name.name,
                    src.span,
                ));
            }
        }
        sources
    }
pub fn load_datasources_from_ast ( & self , ast_schema : & ast :: SchemaAst , preview_features : & HashSet < & PreviewFeature > , diagnostics : & mut Diagnostics , ) -> Vec < Datasource > { let mut sources = Vec :: new ( ) ; for src in ast_schema . sources ( ) { if let Some ( source ) = self . lift_datasource ( & src , preview_features , diagnostics ) { sources . push ( source ) } } if sources . len ( ) > 1 { for src in ast_schema . sources ( ) { diagnostics . push_error ( DatamodelError :: new_source_validation_error ( & " " . to_string ( ) , & src . name . name , src . span , ) ) ; } } sources }
Loads all datasources from the provided schema AST.
Loads all datasources from the provided schema AST .
&self
ast_schema
&ast::SchemaAst
preview_features
&HashSet<&PreviewFeature>
diagnostics
&mut Diagnostics