uqa_sql/params.rs
1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Bind parameters for `Engine::sql(query, params)`.
8
9use uqa_core::Value;
10
11/// Value bound to a `$N` placeholder.
12#[derive(Debug, Clone)]
13pub enum SQLParam {
14 Scalar(Value),
15 Vector(Vec<f32>),
16 Tensor(Vec<Vec<f32>>),
17}
18
19impl SQLParam {
20 pub fn scalar(value: Value) -> Self {
21 Self::Scalar(value)
22 }
23
24 pub fn vector(v: Vec<f32>) -> Self {
25 Self::Vector(v)
26 }
27
28 pub fn tensor(v: Vec<Vec<f32>>) -> Self {
29 Self::Tensor(v)
30 }
31}