You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using execute() I can parse the command output for INSERT to confirm a single row inserted like INSERT 0 1. However, execute() does not support the LRU for automatically prepared statements. Can you document how to confirm that the INSERT worked using a fetch*() method that will use the LRU? I do sometimes see INSERT 0 0 results in some high-volume workloads (likely just duplicate data), and these do not raise UniqueViolationError, QueryCanceledError, or some TimeoutError.
The text was updated successfully, but these errors were encountered:
execute() uses prepared statements if there are arguments, which is likely in the case of insert.
I do sometimes see INSERT 0 0 results in some high-volume workloads
Depending on how your insert body looks it's totally possible to insert zero rows. For example, INSERT INTO foo (select * where false) will return INSERT 0 0.
@elprans ahh thanks, I was going by the documentation which excludes execute() for the built-in LRU cache of prepared statements and only includes fetch*().
asyncpg automatically maintains a small LRU cache for queries executed during calls to the fetch(), fetchrow(), or fetchval() methods.
When using
execute()
I can parse the command output for INSERT to confirm a single row inserted likeINSERT 0 1
. However,execute()
does not support the LRU for automatically prepared statements. Can you document how to confirm that theINSERT
worked using afetch*()
method that will use the LRU? I do sometimes seeINSERT 0 0
results in some high-volume workloads (likely just duplicate data), and these do not raiseUniqueViolationError
,QueryCanceledError
, or someTimeoutError
.The text was updated successfully, but these errors were encountered: