summaryrefslogtreecommitdiffstats
path: root/Doc/includes
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2022-04-15 00:02:56 (GMT)
committerGitHub <noreply@github.com>2022-04-15 00:02:56 (GMT)
commitee475430d431814cbb6eb5e8a6c0ae51943349d4 (patch)
treee9464bb51a6304a77da9461d28564b00689edfc1 /Doc/includes
parentc9d41bcd68dbe339396523e931904930a87819b9 (diff)
downloadcpython-ee475430d431814cbb6eb5e8a6c0ae51943349d4.zip
cpython-ee475430d431814cbb6eb5e8a6c0ae51943349d4.tar.gz
cpython-ee475430d431814cbb6eb5e8a6c0ae51943349d4.tar.bz2
gh-69093: Support basic incremental I/O to blobs in `sqlite3` (GH-30680)
Authored-by: Aviv Palivoda <palaviv@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no> Co-authored-by: palaviv <palaviv@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Doc/includes')
-rw-r--r--Doc/includes/sqlite3/blob.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/includes/sqlite3/blob.py b/Doc/includes/sqlite3/blob.py
new file mode 100644
index 0000000..61994fb
--- /dev/null
+++ b/Doc/includes/sqlite3/blob.py
@@ -0,0 +1,12 @@
+import sqlite3
+
+con = sqlite3.connect(":memory:")
+con.execute("create table test(blob_col blob)")
+con.execute("insert into test(blob_col) values (zeroblob(10))")
+
+blob = con.blobopen("test", "blob_col", 1)
+blob.write(b"Hello")
+blob.write(b"World")
+blob.seek(0)
+print(blob.read()) # will print b"HelloWorld"
+blob.close()