what is the best way to handle the null in Postgres? in the code below, application 2's display_name is null in Postgres.
use postgres::{Client, Error, NoTls};
fn print_application_data() {
let connect_str = "host=localhost dbname=test";
let mut client = Client::connect(&connect_str, NoTls)?;
let query = "SELECT id, display_name FROM applications WHERE id IN (1,2)";
let rows = client.query(query, &[])?;
for row in rows {
let id: i64 = row.get("id");
let display_name: &str = row.get("display_name");
println!("id: {}, display_name: {}", id, display_name);
}
}
id: 1, display_name: Chrome
thread 'main' panicked at error retrieving column display_name:
error deserializing column 1: a Postgres value was `NULL`',