Skip to main content
pub enum SqlParameters 
    Text(String),
    Values(Vec<String>),
    Json(Value),

The query parameters of Kinetica::execute_with_parameters and Kinetica::query_with_parameters, sent as the query_parameters SQL option.

Variants

Text(String)

Parameters given as text, sent as they are.

Values(Vec<String>)

Parameter values, sent as a JSON array.

Json(Value)

Parameters of any JSON type – numbers, booleans, nulls, text, arrays and objects – sent as JSON text. So [1, 2.5, null] goes as [1,2.5,null], typed, where Self::Values would send text. Build it with serde_json::json!, or from a Vec<serde_json::Value>.

The server decides what it takes. Kinetica 7.2.3.21 binds numbers, text and nulls with their types (SELECT $1 of [1, null] is an int and a null), refuses a boolean (“Unexpected json value in query_parameters”), and takes nested arrays only for an INSERT.

Trait Implementations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source

fn fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

fn from(values: &[&str]) -> Self

Converts to this type from the input type.
Source

fn from(text: &str) -> Self

Converts to this type from the input type.
Source

fn from(text: String) -> Self

Converts to this type from the input type.
Source

fn from(value: Value) -> Self

Converts to this type from the input type.
Source

fn from(values: Vec<String>) -> Self

Converts to this type from the input type.
Source

fn from(values: Vec<Value>) -> Self

Converts to this type from the input type.
Source

fn eq(&self, other: &SqlParameters) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.