Workflow
Where is the schema defined?β
- Source code: glean/schema/source
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:
- Haskell: glean/client/hs/example/Example.hs
Experimenting with schemasβ
Modify the source files in glean/schema/source
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 withmkdir ~/local/gleandb
.Test it with some example data: see Loading a DB from JSON in the shell.
Iterate as necessary, using
:reload
in the shell to reload the schema.