Tokio postgres bulk insert

I was trying to find example for bulk insert using tokio postgres, the examples given by chat gpt didn't compile(may be I don't have sufficient knowledge in rust), simple insert worked, can some one share compliable example of bulk insert or point to example from where i can build my sample example

The tokio-postgres crate just takes an SQL statement as a string, so you do a bulk insert by sending it an SQL statement that inserts multiple elements.

1 Like

COPY queries can be more efficient for bulk inserts as well: rust-postgres/tokio-postgres/tests/test/ at master · sfackler/rust-postgres · GitHub


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.