Skip to content

Commit

Permalink
Add ScalarValue, use it as params for esql.query
Browse files Browse the repository at this point in the history
  • Loading branch information
Anaethelion committed Nov 23, 2023
1 parent f9b9228 commit 0c4bda0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions specification/_types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions specification/esql/query/QueryRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<FieldValue>
params?: Array<ScalarValue>
pragmas?: Pragmas
/**
* The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.
Expand Down

0 comments on commit 0c4bda0

Please sign in to comment.