Generate Elixir modules from one or more FlatBuffers .fbs files.
mix flatbuf.gen SCHEMA.fbs [SCHEMA.fbs ...] [--out PATH] [--wire-module NAME]
[--namespace NAME] [--include PATH]
[--niceties PROTO,PROTO ...]
[--force]Each schema is parsed and resolved, then turned into a set of .ex files
written under --out (default lib/). The Wire helper module is shared
across all generated tables for the run; pass --wire-module to control
its name (default Flatbuf.Generated.Wire).
Options
--out PATH— output directory (defaultlib).--wire-module NAME— module name for the emitted wire helper.--namespace NAME— replace the.fbsfile'snamespacedeclaration when naming Elixir modules. Useful for vendoring an upstream schema (e.g. Apache Arrow) under your project's own namespace tree. Every generated module's name becomesNAME.<short_name>, regardless of what the schema declared.--include PATH— additional directory to search forincludefiles (the schema's own directory is always searched first). Repeatable.--niceties LIST— comma-separated opt-in protocols/behaviours to wire into generated tables. Currently supported:behaviour(implementsFlatbuf.Table),jason(derivesJason.Encoder). Unknown names abort the task.--force— overwrite outputs even when their content is unchanged.
Nicety dependency caveats
Niceties add references the consumer project must satisfy:
jason— the generated@derive Jason.Encoderonly compiles if your project depends on:jason. Add{:jason, "~> 1.4"}to your deps before enabling it.behaviour— the generated@behaviour Flatbuf.Tableneeds:flatbufavailable when the generated code compiles. If you depend on:flatbufwithonly: [:dev, :test], prod compiles will warn that theFlatbuf.Tablebehaviour is undefined (a hard failure under--warnings-as-errors). Use a regular dependency if you enable this nicety.