-
I have a table I want to construct 2 insert queries and execute them in a single transaction. The first query will insert an appointment into the As far as I understand, the bulk insert is what is needed for the second query.
How to construct such insert query using And the second part of the question. As far as I know, there are two approaches how to insert multiple rows into a table:
The second option looks more performant for me, but as far as I newbie in this topic I can be wrong. What approach is more suitable for sea-query? Maybe I am naive and the bulk insert is not a best practice in the query builder world. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @enheit, welcome! A single insert statement with multiple rows of value is more performant. To construct such insert statement, you need to call either sea-query/tests/mysql/query.rs Lines 1057 to 1078 in eb5705e |
Beta Was this translation helpful? Give feedback.
Hey @enheit, welcome!
A single insert statement with multiple rows of value is more performant. To construct such insert statement, you need to call either
values
/values_panic
methods multiple times. See below for example :)sea-query/tests/mysql/query.rs
Lines 1057 to 1078 in eb5705e