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: coerce.rs
    path of file: ./repos/prisma-engines/query-engine/connectors/sql-query-connector/src/database/operations/read
    
    the code of the file until where you have to start completion: use bigdecimal::{BigDecimal, FromPrimitive, ParseBigDecimalError};
use itertools::Itertools;
use query_structure::*;
use std::{borrow::Cow, io, str::FromStr};

use crate::SqlError;

use super::process::InMemoryProcessorForJoins;

pub(crate) enum I
    
fn coerce_json_virtual_field_to_pv(key: &str, value: serde_json::Value) -> crate::Result<PrismaValue> {
    match value {
        serde_json::Value::Object(obj) => {
            let values: crate::Result<Vec<_>> = obj
                .into_iter()
                .map(|(key, value)| coerce_json_virtual_field_to_pv(&key, value).map(|value| (key, value)))
                .collect();
            Ok(PrismaValue::Object(values?))
        }

        serde_json::Value::Number(num) => num
            .as_i64()
            .ok_or_else(|| {
                build_generic_conversion_error(format!(
                    "Unexpected numeric value {num} for virtual field '{key}': only integers are supported"
                ))
            })
            .map(PrismaValue::Int),

        _ => Err(build_generic_conversion_error(format!(
            "Field '{key}' is not a model field and doesn't have a supported type for a virtual field"
        ))),
    }
}