pub trait FromSource {
    // Required method
    fn from_source<'life0, 'life1, 'async_trait>(
        source: &'life0 Datasource,
        url: &'life1 str,
        features: PreviewFeatures
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Connector + Sized + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

source

fn from_source<'life0, 'life1, 'async_trait>( source: &'life0 Datasource, url: &'life1 str, features: PreviewFeatures ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where Self: Connector + Sized + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Instantiate a query connector from a Datasource.

The resolved url is passed distinctly from the datasource for two reasons:

  1. Extracting the final url from the datasource involves resolving env vars and validating, which can fail with a schema parser error. We want to handle this as early as possible and in a single place.

  2. The url may be modified with the config dir, in the case of Node-API.

Implementors§