nicene icon indicating copy to clipboard operation
nicene copied to clipboard

Add rules for more composable queries

Open uesteibar opened this issue 3 years ago • 0 comments

In order to provide rails for following our new guidelines on how to write Ecto queries, we should have a new Nicene.ComposableQueries check that needs to check for:

  • using as to define aliases when joining schemas
  • using |> from(as: :alias) at the start of a query (aka when a module is directly passed to where, join, select...) to alias that first schema
  • Additionally, we can enforce the usage of the Ecto macro API by checking that we don't pass select:, where: or similar keywords to the from macro.

I'm not entirely sure how doable these are since these ecto functions are actually macros, but let's give it a try.

uesteibar avatar Mar 16 '21 15:03 uesteibar