hi, using postgres-rs, how would I do something li...
# help
b
hi, using postgres-rs, how would I do something like this?
Copy code
rs
pub fn create_client(uri: String, key: String) -> Result<Postgrest, Box<dyn Error>> {
    Ok(Postgrest::new(uri).insert_header("apikey", key));
}
n
Hello @baj! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
🆕 postgres rs return client instance
b
like this!
Copy code
rs
pub fn create_client(uri: String, key: String) -> Result<Postgrest, Box<dyn Error>> {
    let client = Postgrest::new(uri).insert_header("apikey", key);
    Ok(client)
}
n
Thread was archived by @baj. Anyone can send a message to unarchive it.
postgres rs return client instance