JSON_ARRAY

Creates a new JSON array from a variable number of arguments.

If no arguments are provided, it returns an empty JSON array []. The values can be any of the supported Kotlin types which are then converted into their corresponding JSON representations (null, boolean, number, or string). KQLiteColumn instances can also be passed as values.

Example:

// SELECT JSON_ARRAY(1, 2, '3', 4);
// Result: '[1,2,"3",4]'
select(JSON_ARRAY(1, 2, "3", 4)).execute()

// SELECT JSON_ARRAY();
// Result: '[]'
select(JSON_ARRAY()).execute()

Return

A KQLiteJsonArray representing the newly created JSON array.

Author

MOHAMMAD AZIM ANSARI

Parameters

values

The values to include in the JSON array. Can be of any type, including other KQLiteColumn instances.

See also