Understanding TypeSpec Annotations for Ecto Query Functions

150
clicks
Understanding TypeSpec Annotations for Ecto Query Functions

Source: reddit.com

Type: Discussion

The author posted a question on how to correctly create a TypeSpec annotation for functions that are designed to consume and return Ecto queries. They mentioned being aware of the `Ecto.Query.t` type but were unclear on the exact syntax for a complete TypeSpec. They provided an example function, `add_filter`, which takes a query and a keyword list, applies a `where` clause, and presumably returns an updated query.

© HashMerge 2024