Indexes

This section describes introspection of indexes.

Introspection of the schema::Index:

Copy
db> 
... 
... 
... 
... 
... 
... 
... 
... 
... 
... 
WITH MODULE schema
SELECT ObjectType {
    name,
    links: {
        name,
    },
    properties: {
        name,
    }
}
FILTER .name = 'schema::Index';
{
    Object {
        name: 'schema::Index',
        links: {Object { name: '__type__' }},
        properties: {
            Object { name: 'expr' },
            Object { name: 'id' },
            Object { name: 'name' }
        }
    }
}

Consider the following schema:

Copy
type Addressable {
    property address -> str;
}

type User extending Addressable {
    # define some properties and a link
    required property name -> str;

    multi link friends -> User;

    # define an index for User based on name
    index on (.name);
}

Introspection of User.name index:

Copy
db> 
... 
... 
... 
... 
WITH MODULE schema
SELECT Index {
    expr,
}
FILTER .expr LIKE '%.name';
{
    Object {
        expr: '.name'
    }
}

For introspection of the index within the context of its host type see object type introspection.

Light
Dark
System