How do you use a join in a Query All for an array of tablerefs?

Options

I am trying to use a join that take an array of tablerefs and adds the other tables details so that they can be used in the query versus doing it as an addon.

Example:

Events table has an artists column that is a list/array of artist_ids that reference their corresponding row in the Artists table.

I am creating a text field search for events that I'd like to include artist names in that search along with the current event name and description to make it more effective at returning relevant results.

If i want to include artist names in the search index in the Events table, I assume I'll need to include the artist names as a string field in the events table, but hoping there's a way around it as I'm trying to avoid duplicating data across tables.

Best Answer

  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Answer ✓
    Options

    You can achieve this by "in" operator. So you are taking your artists table and join it with condition

    artist.id in event.artists_list (I'm assuming that your structure looks somewhat like that)

Answers