From a9a5bb5bc501d06f73507b20466aa0f4982d1be0 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 21 Aug 2020 10:37:21 +0100 Subject: [PATCH] Add note to Writer documentation --- internal/sqlutil/writer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/sqlutil/writer.go b/internal/sqlutil/writer.go index 6e5ff5705..5d93fef4d 100644 --- a/internal/sqlutil/writer.go +++ b/internal/sqlutil/writer.go @@ -36,6 +36,9 @@ import "database/sql" // will ALWAYS be nil in this mode. This is useful if you just // want to perform a single query on an already-prepared statement // without the overhead of opening a new transaction to do it in. +// +// You MUST take particular care not to call Do() from within f() +// on the same Writer, or it will likely result in a deadlock. type Writer interface { // Queue up one or more database write operations within the // provided function to be executed when it is safe to do so.