Skip to main content


Where is the schema defined?​

Thrift types generated from the schema​

The schema is compiled into Thrift files and language-specific support code, which can be used directly by clients for querying Glean. This means that you can query Glean using native types and data structures in whatever language you're using.

The Thrift files are generated by

make gen-schema

In the root of the Glean repository. This puts files in glean/schema/thrift, which are then processed into Haskell code by

make thrift-schema-hs

and finally built by

make glean

Examples of code using these types:

Experimenting with schemas​

  1. Modify the source files in glean/schema/source

  2. Start up the shell locally using your schema:
    glean shell --db-root ~/local/gleandb --schema glean/schema/source
    If you don't already have a ~/local/gleandb for storing local DBs, create it with mkdir ~/local/gleandb.

  3. Test it with some example data: see Loading a DB from JSON in the shell.

  4. Iterate as necessary, using :reload in the shell to reload the schema.