Using FlakeId in JSON field #5

Open
opened 2020-12-03 04:11:03 +00:00 by alexgleason · 0 comments
Member

In order to do a join on a json field, we can't store the FlakeId strings, we can only store a UUID string. Eg:

%Example{
  id: "A1oBVcaRQRCOdu9tuy",
  data: %{
    "user_id" => "00000175-d284-af33-8cdd-4241fb990000"
  }
}

This makes a join ... on users.id = example.data->>'user_id'::uuid possible. Wondering if there's a more semantic way to do this.

In order to do a join on a json field, we can't store the FlakeId strings, we can only store a UUID string. Eg: ```elixir %Example{ id: "A1oBVcaRQRCOdu9tuy", data: %{ "user_id" => "00000175-d284-af33-8cdd-4241fb990000" } } ``` This makes a `join ... on users.id = example.data->>'user_id'::uuid` possible. Wondering if there's a more semantic way to do this.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma-elixir-libraries/flake_id#5
No description provided.