Squirrelix.Query (Squirrelix v0.5.1)

Copy Markdown View Source

A parsed SQL query file.

Part of the supported public API only as the argument to Squirrelix.Inference.Inferrer callbacks (and to functions returned by Squirrelix.Postgres.inferrer/1). Fields are plain struct keys:

  • :file — absolute path to the .sql file
  • :starting_line — 1-based start of the query body
  • :name — Elixir function name derived from the file basename
  • :comment — leading -- comment lines (become @doc)
  • :content — full file contents

Parsing helpers on this module are internal and may change without notice. Prefer Squirrelix.generate/3 / Mix tasks for normal use.

Summary

Types

t()

@type t() :: %Squirrelix.Query{
  comment: [String.t()],
  content: String.t(),
  file: String.t(),
  name: String.t(),
  starting_line: pos_integer()
}