https://supabase.com/ logo
Hey team, I have create a csv importer to insert r...
# help
a
Hey team, I have create a csv importer to insert rows in the DB. I have a few issues with it, I tried to bulk insert 100 then 50 then 20 rows at a time which always crash. Doing with 10 rows at a time works fine until you reach the 140-150 rows which crashes. I'm using Nextjs api route to do so. I wanted to check Supabase Postgres logs to see if it was the issue or my actual API route but always have a error code 400... Questions: What's Supabase limitation with bulk import and how to handle them?
n
Hello @Alan Coppin! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
s
Hi, I have easily imported 1.5M+ rows and 10 column via direct import. I think the API route has issues.
a
Hi, did you do pass your whole 1.5M length array into
.insert()
?
s
> Doing with 10 rows at a time works fine until you reach the 140-150 rows which crashes. Using bulk
insert()
was reported to be fast for > 1000 rows before: https://github.com/supabase/supabase-js/issues/195#issuecomment-855317950 So this should be a problem with the Nextjs api route.
a
Thanks guys, I will investigate the API route then 😄 narrows down the issue