Is this documentation correct on bulk inserts? #3569
-
I am trying to insert multiple rows in one query and was following this: https://github.com/launchbadge/sqlx/blob/main/FAQ.md#how-can-i-bind-an-array-to-a-values-clause-how-can-i-do-bulk-inserts The example code provided there doesnt work and I get syntax error:
I checked in the code that indeed it just takes a single argument.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
The compile time checked macro API ( You will need to make a choice between the two Apis depending on your use case. |
Beta Was this translation helpful? Give feedback.
here are the docs for that:
https://docs.rs/sqlx/latest/sqlx/fn.query.html#you-should-always-prefer-query-parameters-for-dynamic-input
The
QueryBuilder
also works, shure.Docs for this: https://docs.rs/sqlx/latest/sqlx/struct.QueryBuilder.html#example-mysql