diff --git a/napi/src/database.rs b/napi/src/database.rs index ede8b051..02135172 100644 --- a/napi/src/database.rs +++ b/napi/src/database.rs @@ -28,7 +28,9 @@ use std::collections::HashMap; use std::sync::Arc; use tokio::sync::Mutex; -use databricks_sql_kernel::{AuthConfig, DefaultOpts, Error as KernelError, HttpConfig, Session}; +use databricks_sql_kernel::{ + AuthConfig, DefaultOpts, Error as KernelError, HttpConfig, ResultConfig, Session, +}; /// NodeJS-driver-appropriate default for `pool_max_idle_per_host`. /// @@ -146,6 +148,19 @@ pub struct ConnectionOptions { /// Napi-rs serialises `u32` as JS `number`; values up to /// `2^32 - 1` round-trip safely (any reasonable pool size fits). pub max_connections: Option, + /// Render `INTERVAL` / `DURATION` result columns as strings + /// (`ResultConfig.intervals_as_string`). The kernel default is + /// native Arrow `month_interval` / `duration[us]` types; the NodeJS + /// Thrift driver surfaces intervals as strings, so the SEA driver + /// sets this `true` for byte-compatible parity. Omitted ⇒ kernel + /// default (native Arrow interval types). + pub intervals_as_string: Option, + /// Render complex (`ARRAY` / `MAP` / `STRUCT` / `VARIANT`) result + /// columns as JSON strings (`ResultConfig.complex_types_as_json`) + /// instead of native Arrow nested types. Omitted ⇒ kernel default + /// (native Arrow nested types, which the NodeJS Arrow decoder + /// already renders identically to the Thrift path). + pub complex_types_as_json: Option, } /// Require a non-empty `Option` field for a given auth mode, @@ -238,6 +253,19 @@ pub async fn open_session(options: ConnectionOptions) -> napi::Result