Literals

Literal expressions — null, bool, number, string, array, object — evaluated via select with no from clause.

Null Literal

Null literal evaluates to null.

SQL

select null;

Result

[
  null
]

True Boolean Literal

True boolean literal.

SQL

select true;

Result

[
  true
]

False Boolean Literal

False boolean literal.

SQL

select false;

Result

[
  false
]

Integer Number Literal

Integer number literal.

SQL

select 1;

Result

[
  1
]

Floating-point Number Literal

Floating-point number literal.

SQL

select 1.5;

Result

[
  1.5
]

Integer At

Integer at the edge of exact float representation (2^53).

SQL

select 9007199254740992;

Result

[
  9007199254740992
]

Single-quoted String Literal

Single-quoted string literal.

SQL

select 'hello';

Result

[
  "hello"
]

Empty String Literal

Empty string literal.

SQL

select '';

Result

[
  ""
]

Embedded Single

Embedded single quote is escaped by doubling.

SQL

select 'it''s';

Result

[
  "it's"
]

String With

String with Unicode content.

SQL

select 'café';

Result

[
  "café"
]

Empty Array Literal

Empty array literal.

SQL

select [];

Result

[
  []
]

Array Literal

Array literal with two elements yields a single array value.

SQL

select [1, 2];

Result

[
  [ 1, 2 ]
]

Array Literal

Array literal of numbers.

SQL

select [1, 2, 3];

Result

[
  [ 1, 2, 3 ]
]

Array With

Array with mixed types.

SQL

select [1, 'a', null, true];

Result

[
  [ 1, "a", null, true ]
]

Nested Array Literal

Nested array literal.

SQL

select [[1, 2], [3, 4]];

Result

[
  [ [ 1, 2 ], [ 3, 4 ] ]
]

Empty Object Literal

Empty object literal.

SQL

select {};

Result

[
  {  }
]

Object Literal

Object literal with two members.

SQL

select {x: 1, y: 2};

Result

[
  { "x": 1, "y": 2 }
]

Object Key

Object key as string literal.

SQL

select {'a-b': 1};

Result

[
  { "a-b": 1 }
]

Nested Object

Nested object and array in a literal.

SQL

select {items: [1, 2], meta: {n: 2}};

Result

[
  { "items": [ 1, 2 ], "meta": { "n": 2 } }
]

Keywords Are Case-insensitive

Keywords are case-insensitive.

SQL

SELECT null;

Result

[
  null
]

SQL

SELECT null;

Select True;

Result

[
  true
]