Code interface to update resource with composite primary keys

Using the default update code interface, what is the syntax for updating a resource that has a composite primary key?

Currently, you pass the record to be updated in. Resource.update(%TheRecord{}). Soon there will be a variation of that that supports passing a primary key or a composite primary key as a map. i.e Resource.update("id", ...) or Resource.update(%{a: 1, b: 2}, ...). But not quite yet.

2 Likes

That makes total sense, I’ve just gotten used to ids I forgot that you can use the resource. The future update makes sense to me too. Good stuff. Thanks again.

1 Like