Squirrelix.Postgres (SquirrElix v0.5.11)

Copy Markdown View Source

Postgrex-backed query inferrer.

Supported public API

Other functions in this module are internal and may change without notice. Connection resolution for Mix tasks is documented in the Configuration guide; do not call Mix-oriented helpers from application code.

Summary

Functions

Returns an inferrer function for Squirrelix.generate/3 / check/3.

Functions

inferrer(conn)

@spec inferrer(Postgrex.conn()) :: Squirrelix.Inference.inferrer()

Returns an inferrer function for Squirrelix.generate/3 / check/3.

The returned function takes a Squirrelix.Query and returns {:ok, [params: ..., returns: ...]} or {:error, structured_error}.

OID→type and column-nullability catalog lookups are memoised for the lifetime of the returned function so a generate/check pass does not re-query the same catalog rows for every parameter and column.