Squirrelix.Postgres (Squirrelix v0.4.0)

Copy Markdown View Source

Postgrex-backed query inferrer for Squirrelix inference.

Summary

Functions

Opens a Postgrex connection after a synchronous probe so connection failures and timeouts become structured Squirrelix errors.

Converts Squirrelix connection options into a Postgrex start_link/1 keyword list.

Functions

connect(connection_options)

@spec connect(Squirrelix.ConnectionOptions.t()) :: {:ok, pid()} | {:error, struct()}

Opens a Postgrex connection after a synchronous probe so connection failures and timeouts become structured Squirrelix errors.

infer(conn, query)

@spec infer(Postgrex.conn(), Squirrelix.Query.t()) ::
  {:ok, keyword()} | {:error, struct()}

inferrer(conn)

postgrex_opts(connection_options)

@spec postgrex_opts(Squirrelix.ConnectionOptions.t()) :: keyword()

Converts Squirrelix connection options into a Postgrex start_link/1 keyword list.