summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/blob.h
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 /Modules/_sqlite/blob.h
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 'Modules/_sqlite/blob.h')
-rw-r--r--Modules/_sqlite/blob.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/Modules/_sqlite/blob.h b/Modules/_sqlite/blob.h
new file mode 100644
index 0000000..418ca03
--- /dev/null
+++ b/Modules/_sqlite/blob.h
@@ -0,0 +1,24 @@
+#ifndef PYSQLITE_BLOB_H
+#define PYSQLITE_BLOB_H
+
+#include "Python.h"
+#include "sqlite3.h"
+#include "connection.h"
+
+#define BLOB_SEEK_START 0
+#define BLOB_SEEK_CUR 1
+#define BLOB_SEEK_END 2
+
+typedef struct {
+ PyObject_HEAD
+ pysqlite_Connection *connection;
+ sqlite3_blob *blob;
+ int offset;
+
+ PyObject *in_weakreflist;
+} pysqlite_Blob;
+
+int pysqlite_blob_setup_types(PyObject *mod);
+void pysqlite_close_all_blobs(pysqlite_Connection *self);
+
+#endif