Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Types

SuperSQL has a comprehensive types system that adheres to the super-structured data model comprising primitive types, complex types, sum types, named types, the null type, and first-class errors and types.

The syntax of individual literal values as well as types follows the SUP format in that any legal SUP value is also a valid SuperSQL literal.

Likewise, any SUP type is also valid type syntax, which may be used in cast expressions or type declarations.

Note that the type decorators in SUP utilize a double colon (::) syntax that is compatible with cast expressions.

Arguments to functions and operators are all dynamically typed, yet certain functions expect certain specific types or classes of data types. The following names for these categories of types are used in throughout the documentation:

  • any - any SuperSQL data type
  • float - any floating point type
  • int - any signed or unsigned integer type
  • number - either float or int
  • record - any record type
  • set - any set type
  • map - any map type
  • function - a function reference of lambda expression

To be clear, none of these categorical names are actual types and may not be used in a SuperSQL query. They are simply used to document expected type categories.

Note

In a future version of SuperSQL, user-defined function and operator declarations will include optional type signatures and these names representing type categories may be included in the language for that purpose.