[PROPOSAL] Support index order when creating indexes

12 views
Skip to first unread message

Philip Munksgaard

unread,
Mar 24, 2025, 4:43:05 AMMar 24
to elixir-ecto
When ordering in a query, it is possible to use e.g. `desc_nulls_last` to specify the exact ordering. However, it doesn't seem like it is possible to create indexes to match.

I expected something like this to work:

```
create index(:foos, [:bar_id, desc_nulls_last: :inserted_at])
```

I realize that I can just use a string fragment to get the desired index, but I was wondering if this was something you had considered supporting something like the above in the DSL.

Best,
Philip

José Valim

unread,
Mar 24, 2025, 5:56:56 AMMar 24
to elixi...@googlegroups.com
Please do try a pull request, it seems like a natural addition to what we do, but only after trying it we will know for sure if it conflicts with something else. Thanks!


--
You received this message because you are subscribed to the Google Groups "elixir-ecto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-ecto...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/elixir-ecto/4dbad7d7-89be-499d-b61a-538a5abc1629n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages