diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2022-04-15 00:02:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-15 00:02:56 (GMT) |
commit | ee475430d431814cbb6eb5e8a6c0ae51943349d4 (patch) | |
tree | e9464bb51a6304a77da9461d28564b00689edfc1 /Doc/includes | |
parent | c9d41bcd68dbe339396523e931904930a87819b9 (diff) | |
download | cpython-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.py | 12 |
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() |