{"record":{"id":"1d7c6824ab56b1dd","repo":"influxdata/influxdb","slug":"provided-parameter-name-could-not-be-converted-to-a-statment","errorCode":null,"errorMessage":"provided parameter ('{name}') could not be converted to a statment parameter","messagePattern":"provided parameter \\('(.+?)'\\) could not be converted to a statment parameter","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_client/src/lib.rs","lineNumber":37,"sourceCode":"use influxdb3_types::http::*;\npub use influxdb3_types::write::Precision;\n\n/// Primary error type for the [`Client`]\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(\"base URL error: {}\", reqwest_description(.0))]\n    BaseUrl(#[source] reqwest::Error),\n\n    #[error(\"request URL error: {0}\")]\n    RequestUrl(#[from] url::ParseError),\n\n    #[error(\"failed to read the API response bytes: {}\", reqwest_description(.0))]\n    Bytes(#[source] reqwest::Error),\n\n    #[error(\"failed to serialize the request body: {0}\")]\n    RequestSerialization(#[source] serde_json::Error),\n\n    #[error(\n        \"provided parameter ('{name}') could not be converted \\\n        to a statment parameter\"\n    )]\n    ConvertQueryParam {\n        name: String,\n        #[source]\n        source: iox_query_params::Error,\n    },\n\n    #[error(\"invalid UTF8 in response: {0}\")]\n    InvalidUtf8(#[from] FromUtf8Error),\n\n    #[error(\"failed to parse JSON response: {}\", reqwest_description(.0))]\n    Json(#[source] reqwest::Error),\n\n    #[error(\"failed to parse plaintext response: {}\", reqwest_description(.0))]\n    Text(#[source] reqwest::Error),\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_client/src/lib.rs#L19-L55","documentation":"Error::ConvertQueryParam is raised when a caller-supplied parameter value cannot be converted into a query statement parameter; the parameter's name is included and the underlying iox_query_params::Error is the source. It is a type/conversion failure between the caller's value and the query parameter model.","triggerScenarios":"Calling client query APIs with bind parameters whose values are not representable as statement parameters (e.g. wrong type for a $param, unsupported value kind passed through influxdb3_types query parameter conversion).","commonSituations":"Passing JSON-derived values (strings where ints are expected, nested objects) as bind parameters; schema changes in the query template no longer matching parameter types.","solutions":["Check the parameter's value type against the expected statement parameter type and convert it explicitly before binding.","Inspect the source iox_query_params::Error for the exact conversion that failed.","Validate parameters against the query schema before invoking the client call."],"exampleFix":"// before\nparams.insert(\"limit\".into(), json!(\"10\")); // string where int expected\n// after\nparams.insert(\"limit\".into(), json!(10));","handlingStrategy":"validation","validationCode":"// check each bind param converts before calling the client\nfn check_param(name: &str, v: &QueryValue) -> Result<(), String> {\n    // ensure value kind matches the statement parameter type expected by the query\n    v.to_statement_param().map(|_| ()).map_err(|e| format!(\"param '{name}': {e}\"))\n}","typeGuard":"fn is_query_value(v: &serde_json::Value) -> bool {\n    matches!(v, serde_json::Value::Number(_) | serde_json::Value::String(_) | serde_json::Value::Bool(_))\n}","tryCatchPattern":"match client.query_with_params(sql, params).await {\n    Err(Error::ConvertQueryParam { name, .. }) => Err(anyhow!(\"fix bind param '{name}'\")),\n    other => other,\n}","preventionTips":["Coerce JSON-derived values to expected types before binding.","Keep bind parameter types aligned with the query template schema.","Log parameter names/types when query building fails."],"tags":["query-parameters","type-conversion","bind-parameters"],"backgroundTag":"invalid-query-parameter","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}