pub fn create_new_portal(
        &mut self,
        stmt: Option<Statement<Raw>>,
        desc: StatementDesc,
        parameters: Params,
        result_formats: Vec<Format>,
    ) -> Result<String, CoordError> {
        // See: https://github.com/postgres/postgres/blob/84f5c2908dad81e8622b0406beea580e40bb03ac/src/backend/utils/mmgr/portalmem.c#L234

        for i in 0usize.. {
            let name = format!("<unnamed portal {}>", i);
            match self.portals.entry(name.clone()) {
                Entry::Occupied(_) => continue,
                Entry::Vacant(entry) => {
                    entry.insert(Portal {
                        stmt,
                        desc,
                        parameters,
                        result_formats,
                        state: PortalState::NotStarted,
                    });
                    return Ok(name);
                }
            }
        }

        coord_bail!("unable to create a new portal");
    }
/// Creates and installs a new portal.
Creates and installs a new portal.
Creates and installs a new portal .
pub fn create_new_portal(
        &mut self,
        stmt: Option<Statement<Raw>>,
        desc: StatementDesc,
        parameters: Params,
        result_formats: Vec<Format>,
    ) -> Result<String, CoordError> {
        // See: https://github.com/postgres/postgres/blob/84f5c2908dad81e8622b0406beea580e40bb03ac/src/backend/utils/mmgr/portalmem.c#L234
        for i in 0usize.. {
            let name = format!("<unnamed portal {}>", i);
            match self.portals.entry(name.clone()) {
                Entry::Occupied(_) => continue,
                Entry::Vacant(entry) => {
                    entry.insert(Portal {
                        stmt,
                        desc,
                        parameters,
                        result_formats,
                        state: PortalState::NotStarted,
                    });
                    return Ok(name);
                }
            }
        }
        coord_bail!("unable to create a new portal");
    }
pub fn create_new_portal ( & mut self , stmt : Option < Statement < Raw > > , desc : StatementDesc , parameters : Params , result_formats : Vec < Format > , ) -> Result < String , CoordError > { // See: https://github.com/postgres/postgres/blob/84f5c2908dad81e8622b0406beea580e40bb03ac/src/backend/utils/mmgr/portalmem.c#L234 for i in 0usize .. { let name = format ! ( " " i ) ; match self . portals . entry ( name . clone ( ) ) { Entry :: Occupied ( _ ) => continue , Entry :: Vacant ( entry ) => { entry . insert ( Portal { stmt , desc , parameters , result_formats , state : PortalState :: NotStarted , } ) ; return Ok ( name ) ; } } } coord_bail ! ( " " ) ; }
Creates and installs a new portal.
Creates and installs a new portal .
&mut self
stmt
Option<Statement<Raw>>
desc
StatementDesc
parameters
Params
result_formats
Vec<Format>
&mut self
stmt
Option<Statement<Raw>>
desc
StatementDesc
parameters
Params
result_formats
Vec<Format>