nicene
nicene copied to clipboard
Add rules for more composable queries
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 towhere
,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 thefrom
macro.
I'm not entirely sure how doable these are since these ecto functions are actually macros, but let's give it a try.