This section describes introspection of scalar types.

Introspection of the schema::ScalarType:

Copy
db> 
... 
... 
... 
... 
... 
... 
... 
... 
... 
... 
WITH MODULE schema
SELECT ObjectType {
    name,
    links: {
        name,
    },
    properties: {
        name,
    }
}
FILTER .name = 'schema::ScalarType';
{
    Object {
        name: 'schema::ScalarType',
        links: {
            Object { name: '__type__' },
            Object { name: 'annotations' },
            Object { name: 'bases' },
            Object { name: 'constraints' },
            Object { name: 'ancestors' }
        },
        properties: {
            Object { name: 'default' },
            Object { name: 'enum_values' },
            Object { name: 'id' },
            Object { name: 'abstract' },
            Object { name: 'name' }
        }
    }
}

Introspection of the built-in scalar str:

Copy
db> 
... 
... 
... 
... 
... 
... 
... 
... 
... 
... 
... 
WITH MODULE schema
SELECT ScalarType {
    name,
    default,
    enum_values,
    abstract,
    bases: { name },
    ancestors: { name },
    annotations: { name, @value },
    constraints: { name },
}
FILTER .name = 'std::str';
{
    Object {
        name: 'std::str',
        default: {},
        enum_values: {},
        abstract: {},
        bases: {Object { name: 'std::anyscalar' }},
        ancestors: {Object { name: 'std::anyscalar' }},
        annotations: {},
        constraints: {}
    }
}

For an enumerated scalar type, consider the following:

Copy
scalar type Color extending enum<Red, Green, Blue>;

Introspection of the enum scalar Color:

Copy
db> 
... 
... 
... 
... 
... 
... 
... 
... 
... 
... 
... 
WITH MODULE schema
SELECT ScalarType {
    name,
    default,
    enum_values,
    abstract,
    bases: { name },
    ancestors: { name },
    annotations: { name, @value },
    constraints: { name },
}
FILTER .name = 'default::Color';
{
    Object {
        name: 'default::Color',
        default: {},
        enum_values: ['Red', 'Green', 'Blue'],
        abstract: {},
        bases: {Object { name: 'std::anyenum' }},
        ancestors: {
            Object { name: 'std::anyscalar' },
            Object { name: 'std::anyenum' }
        },
        annotations: {},
        constraints: {}
    }
}
Light
Dark
System