You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: identities_repository_sql.rs
    path of file: ./repos/ockam/implementations/rust/ockam/ockam_api/src/cli_state/storage
    
    the code of the file until where you have to start completion: use core::str::FromStr;

use sqlx::*;

use ockam::identity::Identifier;
use ockam_core::async_trait;
use ockam_core::Result;
use ockam_node::database::{FromSqlxError, SqlxDatabase, ToSqlxType, ToVoid};

use crate::cli_state::{IdentitiesRepository, NamedIdentity};

/// Implementation of [`IdentitiesRepository`] trait based on an underlying database
///
    
    async fn get_named_identity(&self, name: &str) -> Result<Option<NamedIdentity>> {
        let query = query_as(
            "SELECT identifier, name, vault_name, is_default FROM named_identity WHERE name=$1",
        )
        .bind(name.to_sql());
        let row: Option<NamedIdentityRow> = query
            .fetch_optional(&*self.database.pool)
            .await
            .into_core()?;
        row.map(|r| r.named_identity()).transpose()
    }