This section describes the SDL declarations pertaining to scalar types.
Declare a new non-negative integer type:
scalar type posint64 extending int64 {
constraint min_value(0);
}
Define a new scalar type corresponding to the more explicit DDL commands.
[abstract] scalar type TypeName [extending supertype [, ...] ]
[ "{"
[ annotation-declarations ]
[ constraint-declarations ]
...
"}" ]
This declaration defines a new object type with the following options:
If specified, the created scalar type will be abstract.
The name (optionally module-qualified) of the new scalar type.
Optional clause specifying the supertype of the new type.
If supertype is an
enumerated type
declaration then
an enumerated scalar type is defined.
Use of extending
creates a persistent type relationship
between the new subtype and its supertype(s). Schema modifications
to the supertype(s) propagate to the subtype.
The valid SDL sub-declarations are listed below:
Set scalar type annotation to a given value.
Define a concrete constraint for this scalar type.