/// Look up the schema for `subgraph` and return its entity table.
/// If `subgraph` does not have an entry in `deployment_schemas`, we assume
/// it has not been migrated yet, and return the `entities` table
/// in the `public` schema
Look up the schema for `subgraph` and return its entity table.
Look up the schema for ` subgraph ` and return its entity table .
fn new(conn: &PgConnection, subgraph: &SubgraphDeploymentId) -> Result<Self, StoreError> {
        let table = match find_schema(conn, subgraph)? {
            Some(sc) => {
                let table = schema(sc.name.clone()).table("entities".to_owned());
                let id = table.column::<Text, _>("id".to_string());
                let entity = table.column::<Text, _>("entity".to_string());
                let data = table.column::<Jsonb, _>("data".to_string());
                let event_source = table.column::<Text, _>("event_source".to_string());
                Table::Split(SplitTable {
                    schema: sc.name,
                    subgraph: subgraph.clone(),
                    table,
                    id,
                    entity,
                    data,
                    event_source,
                })
            }
            None => Table::Public(subgraph.clone()),
        };
        Ok(table)
    }
fn new ( conn : & PgConnection , subgraph : & SubgraphDeploymentId ) -> Result < Self , StoreError > { let table = match find_schema ( conn , subgraph ) ? { Some ( sc ) => { let table = schema ( sc . name . clone ( ) ) . table ( " " . to_owned ( ) ) ; let id = table . column :: < Text , _ > ( " " . to_string ( ) ) ; let entity = table . column :: < Text , _ > ( " " . to_string ( ) ) ; let data = table . column :: < Jsonb , _ > ( " " . to_string ( ) ) ; let event_source = table . column :: < Text , _ > ( " " . to_string ( ) ) ; Table :: Split ( SplitTable { schema : sc . name , subgraph : subgraph . clone ( ) , table , id , entity , data , event_source , } ) } None => Table :: Public ( subgraph . clone ( ) ) , } ; Ok ( table ) }
Look up the schema for `subgraph` and return its entity table.
Look up the schema for ` subgraph ` and return its entity table .
conn
&PgConnection
subgraph
&SubgraphDeploymentId