Local CodeQL-style code search for Elixir, backed by Postgres and ExAST.
Quick start
{:ok, index} = Exograph.index("lib", repo: MyApp.Repo, migrate?: true)
{:ok, hits} = Exograph.search(index, "Repo.get!(_, _)")DSL queries
import Exograph.DSL
query = from(f in Fragment, where: matches(f, "def _ do ... end"))
{:ok, hits} = Exograph.all(index, query)Call graph
{:ok, callers} = Exograph.search_callers(index, "Repo.transaction/1")
{:ok, callees} = Exograph.search_callees(index, "MyApp.create_user/1")
Summary
Functions
@spec all(Exograph.Index.t(), Exograph.DSL.Query.t(), keyword()) :: {:ok, [map()]} | {:error, term()}
@spec index( String.t() | [String.t()], keyword() ) :: {:ok, Exograph.Index.t()} | {:error, term()}
@spec search( Exograph.Index.t() | term(), ExAST.Pattern.pattern() | ExAST.Selector.t(), keyword() ) :: {:ok, [map()]} | {:error, term()}
@spec search_callees(Exograph.Index.t(), String.t(), keyword()) :: {:ok, [Exograph.CallEdge.t()]}
@spec search_callers(Exograph.Index.t(), String.t(), keyword()) :: {:ok, [Exograph.CallEdge.t()]}