pub struct QueryDataParams {
pub data: String,
pub sql: String,
pub format: Option<String>,
pub table_name: Option<String>,
pub schema: Option<Value>,
}Expand description
Schema override shape shared by query_data, query_file, load_data,
and load_file. Documented here once so all four tools can reference it
without duplicating the prose in every field doc.
Pass a JSON object mapping column name → Hyper type string, for example:
{ "year": "INT", "population": "BIGINT", "entity": "TEXT" }Override semantics (applied inside ingest):
- Keys are matched to columns by name (case-sensitive). Column ordering in the JSON object does not need to match the file; the inferred order from the file is preserved.
- Columns not listed in the override keep their inferred type — you only need to specify the columns you want to correct.
- Types are the Hyper SQL type spellings:
INT,BIGINT,NUMERIC(38,0),DOUBLE PRECISION,TEXT,BOOL,DATE,TIMESTAMP. - If you get a
SchemaMismatchwith suggestion to widen an integer column, the typical fix is{ "col": "BIGINT" }or{ "col": "NUMERIC(38,0)" }.
Before ingesting an unfamiliar file, prefer calling inspect_file first —
it returns the inferred schema plus per-column min / max / null_count so
you can build a minimal, correct override in one shot.
Parameters for the query_data one-shot tool.
Fields§
§data: StringJSON array of objects or CSV text.
sql: StringSQL query to run against the data. Reference the table by
table_name (default data).
format: Option<String>Data format: "json" or "csv". Auto-detected from the first byte
when omitted ([/{ → JSON, otherwise CSV).
table_name: Option<String>Table name exposed to the SQL query (default: data).
schema: Option<Value>Partial schema override keyed by column name: {"col": "BIGINT", ...}.
Only the listed columns are overridden; the rest keep their inferred
type. See the struct-level docs on QueryDataParams and the
inspect_file tool for type choices and diagnostics.
Trait Implementations§
Source§impl Debug for QueryDataParams
impl Debug for QueryDataParams
Source§impl<'de> Deserialize<'de> for QueryDataParams
impl<'de> Deserialize<'de> for QueryDataParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for QueryDataParams
impl JsonSchema for QueryDataParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for QueryDataParams
impl RefUnwindSafe for QueryDataParams
impl Send for QueryDataParams
impl Sync for QueryDataParams
impl Unpin for QueryDataParams
impl UnsafeUnpin for QueryDataParams
impl UnwindSafe for QueryDataParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request