/v1/query support set settings.
// See the License for the specific language governing permissions and
// limitations under the License.
+use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::Duration;
use std::time::Instant;
@@ -100,6 +101,7 @@ impl PaginationConf {
pub struct HttpSessionConf {
pub database: Option<String>,
pub max_idle_time: Option<u64>,
+ pub settings: Option<BTreeMap<String, String>>,
}
#[derive(Deserialize, Debug, PartialEq)]
@@ -154,6 +156,12 @@ impl HttpQuery {
if let Some(db) = &session_conf.database {
session.set_current_database(db.clone());
}
+ if let Some(conf_settings) = &session_conf.settings {
+ let settings = session.get_settings();
+ for (k, v) in conf_settings {
+ settings.set_settings(k.to_string(), v.to_string(), false)?;
+ }
+ }
if let Some(secs) = session_conf.max_idle_time {
if secs > 0 {
http_query_manager
