Re: [sqlite] "Pickling" an in-memory SQLite database.

2019-01-31 Thread Thomas Levine
If sqlite3_serialize and sqlite3_deserialize are not exposed in your bindings, I suppose you can do something like with NamedTemporaryFile(mode='rb', prefix=prefix) as tmp: c = sqlite3.connect(tmp.name) # Do stuff. c.close() serialized = tmp.file.read() where "prefix" is a RAM fi

Re: [sqlite] "Pickling" an in-memory SQLite database.

2019-01-31 Thread Shawn Wagner
sqlite3_serialize() and deserialize would work: https://www.sqlite.org/c3ref/serialize.html On Thu, Jan 31, 2019, 4:47 PM Randall Smith Hi, guys. > > I have an application that allows me to embed a (potentially large) block > of data into its application file at close, and read the block back on

[sqlite] "Pickling" an in-memory SQLite database.

2019-01-31 Thread Randall Smith
Hi, guys. I have an application that allows me to embed a (potentially large) block of data into its application file at close, and read the block back on open. It would be convenient and attractive for me, for a plugin I am writing for this application, to be able to use an in-memory SQLite d