{"record":{"id":"0b80020c866cdc13","repo":"influxdata/influxdb","slug":"parameter-type-0-is-not-supported-by-influxql","errorCode":null,"errorMessage":"Parameter type '{0}' is not supported by InfluxQL","messagePattern":"Parameter type '(.+?)' is not supported by InfluxQL","errorType":"validation","errorClass":"BindParameterError","httpStatus":null,"severity":"error","filePath":"core/influxdb_influxql_parser/src/parameter.rs","lineNumber":37,"sourceCode":"use crate::string::double_quoted_string;\nuse crate::visit_mut::{Recursion, VisitableMut, VisitorMut};\nuse crate::{impl_tuple_clause, write_quoted_string};\nuse nom::Parser;\nuse nom::branch::alt;\nuse nom::bytes::complete::tag;\nuse nom::character::complete::{alphanumeric1, char};\nuse nom::combinator::{map, recognize};\nuse nom::multi::many1_count;\nuse nom::sequence::preceded;\nuse std::fmt;\nuse std::fmt::{Display, Formatter, Write};\n\n#[derive(Debug, Clone, Error)]\n/// Errors that occur during bind parameter replacement\npub enum BindParameterError {\n    /// Error that occurs when the user provides a parameter value\n    /// whose type is not supported by InfluxQL.\n    #[error(\"Parameter type '{0}' is not supported by InfluxQL\")]\n    TypeNotSupported(String),\n    /// Error that occurs when the user provides a parameter value that\n    /// was not found within the query/statement.\n    #[error(\"Bind parameter '{0}' was provided but not found in the InfluxQL statement\")]\n    NotFound(String),\n    /// Error that occurs when a query contains a bind parameter placeholder\n    /// but the corresponding parameter value was not provided by the user.\n    #[error(\n        \"Bind parameter '{0}' was referenced in the InfluxQL statement but its value is undefined.\"\n    )]\n    NotDefined(String),\n}\n\n/// Parse an unquoted InfluxQL bind parameter.\nfn unquoted_parameter(i: &str) -> ParseResult<&str, &str> {\n    recognize(many1_count(alt((alphanumeric1, tag(\"_\"))))).parse(i)\n}\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_influxql_parser/src/parameter.rs#L19-L55","documentation":"`BindParameterError::TypeNotSupported` is raised when a bind parameter value has a type InfluxQL cannot substitute into a query. InfluxQL bind parameters only accept a restricted set of scalar types (e.g. strings, numbers, booleans); passing a collection, object, or other unsupported type causes replacement to fail with this error naming the offending type.","triggerScenarios":"Calling the bind-parameter replacement API (parameter.rs) with a parameter value whose type is not supported, e.g. passing an array, struct, or timestamp object as a parameter value for an InfluxQL statement.","commonSituations":"Passing JSON-parsed values straight through where they arrive as arrays/objects; driver clients sending list-valued parameters for IN-style clauses (not supported by InfluxQL parameter substitution); passing DateTime objects instead of RFC3339 strings.","solutions":["Convert the value to a supported scalar type (string, integer/float, boolean) before binding.","For collections, build the query with explicit literals or multiple scalar parameters instead of one list parameter.","Serialize timestamps/complex values to strings in a format InfluxQL understands (e.g. RFC3339) before binding.","Check the parameter type at the API boundary and reject/convert unsupported types early."],"exampleFix":"// before\nlet params = vec![(\"ids\", json!([1, 2, 3]))]; // unsupported type\n// after\nlet params = vec![(\"id\", json!(1))]; // bind one supported scalar per placeholder","handlingStrategy":"validation","validationCode":"fn is_bindable(v: &serde_json::Value) -> bool {\n    matches!(v, serde_json::Value::String(_)\n        | serde_json::Value::Number(_)\n        | serde_json::Value::Bool(_))\n}","typeGuard":null,"tryCatchPattern":"match bind_result {\n    Err(BindParameterError::TypeNotSupported(t)) => {\n        return Err(anyhow!(\"convert parameter of type {t} to a scalar before binding\"));\n    }\n    other => other,\n}","preventionTips":["Restrict parameter values to scalars at the API boundary","Serialize timestamps to RFC3339 strings before binding","Reject list/object parameters early with a clear client-side error"],"tags":["rust","influxql","bind-parameters","type-mismatch"],"backgroundTag":"unsupported-enum-value","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"}