influxdata/influxdb · error · BindParameterError

Parameter type ' ' is not supported by InfluxQL

Error message

Parameter type '{0}' is not supported by InfluxQL

What it means

`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.

Solutions

  1. Convert the value to a supported scalar type (string, integer/float, boolean) before binding.
  2. For collections, build the query with explicit literals or multiple scalar parameters instead of one list parameter.
  3. Serialize timestamps/complex values to strings in a format InfluxQL understands (e.g. RFC3339) before binding.
  4. Check the parameter type at the API boundary and reject/convert unsupported types early.

Example fix

// before
let params = vec![("ids", json!([1, 2, 3]))]; // unsupported type
// after
let params = vec![("id", json!(1))]; // bind one supported scalar per placeholder
Defensive patterns

Strategy: validation

Validate before calling

fn is_bindable(v: &serde_json::Value) -> bool {
    matches!(v, serde_json::Value::String(_)
        | serde_json::Value::Number(_)
        | serde_json::Value::Bool(_))
}

Try / catch

match bind_result {
    Err(BindParameterError::TypeNotSupported(t)) => {
        return Err(anyhow!("convert parameter of type {t} to a scalar before binding"));
    }
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19). Data as JSON: /api/errors/0b80020c866cdc13. Report an issue: GitHub.

Appendix: source

Thrown at core/influxdb_influxql_parser/src/parameter.rs:37

use crate::string::double_quoted_string;
use crate::visit_mut::{Recursion, VisitableMut, VisitorMut};
use crate::{impl_tuple_clause, write_quoted_string};
use nom::Parser;
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete::{alphanumeric1, char};
use nom::combinator::{map, recognize};
use nom::multi::many1_count;
use nom::sequence::preceded;
use std::fmt;
use std::fmt::{Display, Formatter, Write};

#[derive(Debug, Clone, Error)]
/// Errors that occur during bind parameter replacement
pub enum BindParameterError {
    /// Error that occurs when the user provides a parameter value
    /// whose type is not supported by InfluxQL.
    #[error("Parameter type '{0}' is not supported by InfluxQL")]
    TypeNotSupported(String),
    /// Error that occurs when the user provides a parameter value that
    /// was not found within the query/statement.
    #[error("Bind parameter '{0}' was provided but not found in the InfluxQL statement")]
    NotFound(String),
    /// Error that occurs when a query contains a bind parameter placeholder
    /// but the corresponding parameter value was not provided by the user.
    #[error(
        "Bind parameter '{0}' was referenced in the InfluxQL statement but its value is undefined."
    )]
    NotDefined(String),
}

/// Parse an unquoted InfluxQL bind parameter.
fn unquoted_parameter(i: &str) -> ParseResult<&str, &str> {
    recognize(many1_count(alt((alphanumeric1, tag("_"))))).parse(i)
}

View on GitHub (pinned to 06200ef96b)