pub struct LoadFileParams {
pub table: String,
pub path: String,
pub mode: Option<String>,
pub schema: Option<Value>,
pub json_extract_path: Option<String>,
pub merge_key: Option<MergeKey>,
pub database: Option<String>,
pub persist: Option<bool>,
}Expand description
Parameters for the load_file workspace tool.
Fields§
§table: StringTarget table name.
path: StringAbsolute path to a CSV, Parquet, or Arrow IPC file.
mode: Option<String>"replace" (default — drops and recreates the table),
"append" (adds rows to an existing table), or "merge"
(upserts rows by merge_key; new columns in the incoming file
are auto-added via ALTER TABLE ADD COLUMN).
schema: Option<Value>Partial schema override keyed by column name: {"col": "BIGINT", ...}.
Only the listed columns are overridden; the rest keep their inferred
type. Call inspect_file first if you are unsure — it reports
min / max / null_count per column using the exact same inference this
tool uses, so the override you build from its output is guaranteed to
align with the file’s actual columns.
json_extract_path: Option<String>Optional dot-separated path to extract a nested data array from the
JSON file. Numeric segments index into arrays (e.g., content.0).
String values encountered during navigation are automatically parsed
as JSON, handling the common pattern where MCP tool responses contain
stringified JSON payloads.
merge_key: Option<MergeKey>When mode = "merge", the column(s) used to match incoming rows to
existing rows for upsert. Pass a single name ("job_id") or a list
(["cell", "job_id"]). Required for merge; rejected with a clear
error if set for replace or append.
database: Option<String>Target database alias. Omit (or pass "local") to write to the
ephemeral primary. Pass "persistent" to write to the durable
database. Other values target a user-attached writable database.
persist: Option<bool>Shorthand for database: "persistent". If both database and
persist are set, database wins.
Trait Implementations§
Source§impl Debug for LoadFileParams
impl Debug for LoadFileParams
Source§impl<'de> Deserialize<'de> for LoadFileParams
impl<'de> Deserialize<'de> for LoadFileParams
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 LoadFileParams
impl JsonSchema for LoadFileParams
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 LoadFileParams
impl RefUnwindSafe for LoadFileParams
impl Send for LoadFileParams
impl Sync for LoadFileParams
impl Unpin for LoadFileParams
impl UnsafeUnpin for LoadFileParams
impl UnwindSafe for LoadFileParams
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