I import a .csv file with x number of rows directly into a table within Supabase. All the fields at this point are text and a number of columns have repeating data.
I’d like some advice on how to read each row of the .csv file to build a sql insert statement that replaces the text with the primary key from look up tables and then execute it.
Tables and fields I have are as follows
Event(ID, Date, Club(fk), EventType(fk), Description
Club(ID, ClubName) – Club Name is text that will be in the .csv file
EventType(ID, EventType) – EventType is text and will be in the .csv file. There’s a limited number of event types.
EventCsv(Date, Club, EventType, Description)
How to address the problem in Supabase
DavidJ19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.