From 0c4bda06f667f32c07e29ad2113c0cc04bf58c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Saint-F=C3=A9lix?= Date: Thu, 23 Nov 2023 16:38:21 +0100 Subject: [PATCH] Add ScalarValue, use it as params for esql.query --- specification/_types/common.ts | 6 ++++++ specification/esql/query/QueryRequest.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/specification/_types/common.ts b/specification/_types/common.ts index 60aa713a83..732150a2a6 100644 --- a/specification/_types/common.ts +++ b/specification/_types/common.ts @@ -36,6 +36,12 @@ export type FieldValue = | null | UserDefinedValue +/** + * A scalar value. + * @codegen_names long, double, string, boolean, null + */ +export type ScalarValue = long | double | string | boolean | null + export class UrlParameter {} export type Uri = string diff --git a/specification/esql/query/QueryRequest.ts b/specification/esql/query/QueryRequest.ts index 1b0bb98b06..d103b05c5e 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -20,7 +20,7 @@ import { RequestBase } from '@_types/Base' import { QueryContainer } from '@_types/query_dsl/abstractions' import { Pragmas } from '@esql/_types/Pragmas' -import { FieldValue } from '@_types/common' +import { ScalarValue } from '@_types/common' /** * Executes an ES|QL request @@ -56,7 +56,7 @@ export interface Request extends RequestBase { * To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. * @doc_id esql-query-params */ - params?: Array + params?: Array pragmas?: Pragmas /** * The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.