Arjun Bajaj
AEAsh Elixir
•Created by Arjun Bajaj on 2/20/2023 in #support
Only change a few fields `ON CONFLICT` in an Upsert
Let's say I am implementing GitHub login myself. I have a User resource with a few attributes, and its create action is an
upsert
. Its working and Ash generates the right query, however, I want Ash to not include a few fields in the ON CONFLICT
part.
This is the query Ash generates:
I would instead want this (only two fields instead of all):
How would I go about doing this?
This is my current action:
6 replies
AEAsh Elixir
•Created by Arjun Bajaj on 2/18/2023 in #support
How do you set an attribute to the join resource when creating?
For example, I have a
User
and an Org
, joined by a many_to_many
through a Join Resource UserOrg
.
UserOrg
has an attribute :role
. How do I set the role
on the UserOrg
when creating an Org
?
26 replies
AEAsh Elixir
•Created by Arjun Bajaj on 2/16/2023 in #support
Differences between ETS and Postgres
So my thinking right now is, I'm using ETS to build out all of my resources and basically the app for as long as I can get away with. I do realize there are some differences between the Postgres adapter and ETS such as when it comes to identities where you've to add
pre_check_with
. However, are there some major differences where Ash is not able to abstract away the data layer and the code would actually be different for the two?
I just wanted to keep open the option of selecting a database later. Maybe PlanetScale (which is MySQL, but doesn't support foreign key constraints and has some other limitations too), or Postgres or SQLite. Of course I understand we'll have to figure out how to create a data layer for those as they don't exist in Ash right now, but maybe I could help with one of those if we decide to go that route?17 replies