From c1915feb2e5b88fb3f4bb8fe5a394261a0ff0eff Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Fri, 6 Sep 2024 13:15:20 -0400 Subject: [PATCH] Expand explanation of openblob semantics (#149) Per @ncruces' comments in https://github.com/ncruces/go-sqlite3/issues/148#issuecomment-2334155468, this change clarifies the documentation for openblob to help clients understand the lifecycle of the blob handle within the callback. --- ext/blobio/blob.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/blobio/blob.go b/ext/blobio/blob.go index 1cc6a7c..be5bdba 100644 --- a/ext/blobio/blob.go +++ b/ext/blobio/blob.go @@ -27,6 +27,10 @@ import ( // using [sqlite3.BindPointer] or [sqlite3.Pointer]. // The optional args will be passed to the callback, // along with the [sqlite3.Blob] handle. +// The [sqlite3.Blob] handle is only valid during +// the execution of the callback. Callers cannot +// read or write to the handle after the callback +// exits. // // https://sqlite.org/c3ref/blob.html func Register(db *sqlite3.Conn) error {