Fathom.Store (fathom v0.1.0)

Copy Markdown View Source

Writes buffered facts into a SQLite file.

The whole dump is one transaction with journalling disabled. The database is a derived artefact rebuilt from scratch on every run, so there is nothing to protect against a crash halfway through: if the build dies you re-run it. That buys roughly an order of magnitude over the default durable settings on a few million rows.

Indexes are created after the load rather than before. Module and file names repeat constantly across facts, so both are memoised while folding; without that, inspect/1 on module atoms dominates the dump.

Summary

Functions

Formats an MFA tuple the way the database stores it.

Builds the database at path from the facts currently buffered.

Functions

mfa_string(arg)

Formats an MFA tuple the way the database stores it.

write(path, root, meta \\ %{})

Builds the database at path from the facts currently buffered.

root is the project directory; file paths are stored relative to it so the database is portable and the paths are the ones an agent can open directly.