Create Execute library function
Create Execute library function

Execute runs fn and retries it as needed. It is used to add retry handling to
the execution of a single statement or single batch of statements. If a
multi-statement transaction is being run, use ExecuteTx instead.

Retry handling for individual statements (implicit transactions) is usually
performed automatically on the CockroachDB SQL gateway. As such, use of this
function is generally not necessary. The exception to this rule is that
automatic retries for individual statements are disabled once CockroachDB
begins streaming results for the statements back to the client. By default,
result streaming does not begin until the size of the result being produced
for the client, including protocol overhead, exceeds 16KiB. As long as the
results of a single statement or batch of statements are known to stay clear
of this limit, the client does not need to worry about retries and should not
need to use this function.

For more information about automatic transaction retries in CockroachDB, see
https://cockroachlabs.com/docs/stable/transactions.html#automatic-retries.

cockroachdb/cockroach-go