Scalars

All data in EdgeDB boils down to some scalar values: numbers, booleans, text, date, time, or JSON. So let's start with learning what these scalar types are and how they interact with each other.

There are some basic scalars that have their own literal representations. They are: booleans, strings, bytes, and numbers.

The boolean values are represented by the words "true" and "false" (case-insensitive). Try selecting a boolean literal:

Input

String literals are just anything put inside either a pair of single or double quotes. They also support special escaped characters, such as "\n" for a new-line or even unicode. Try them out:

Input

Bytes are very similar to strings in structure, but the bytes literabls start with a b prefix. Since the characters inside the bytes literal are supposed to represent one byte each, no unicode characters are allowed. Try them out:

Input

Number literals are a bit more diverse. Broadly all numbers can be divided into 2 categories based on whether they are of limited finite size in memory or unlimited. By default number literals are taken to represent the limited size integer or floating-point numbers used in many programming languages. But literals with an n suffix represent integers or decimals of unbounded size and precision. Try them out:

Input
Input