5.15.2015

extracting my notes from drafts app database

well now. while digging into the content stored in my iphone, i found out the drafts app which I'm slowly abandoning by removing my content uses a sqlite3 database. previously I had no way to bulk-extract my notes.
# sqlite3 Drafts.sqlite
SQLite version 3.8.2 2013-12-06 14:53:30
...
sqlite> .tables

ZSPMANAGEDOBJECT  Z_METADATA        Z_PRIMARYKEY 

sqlite> .schema zspmanagedobject
...
CREATE TABLE ZSPMANAGEDOBJECT (
Z_PK INTEGER PRIMARY KEY, 
Z_ENT INTEGER, 
Z_OPT INTEGER, 
ZARCHIVED INTEGER, 
ZHIDDEN INTEGER, 
ZPINNED INTEGER, 
ZCREATED_AT TIMESTAMP, 
ZLAST_ACTION_AT TIMESTAMP, 
ZMODIFIED_AT TIMESTAMP, 
ZUPDATED_AT TIMESTAMP, 
ZGHOSTDATA VARCHAR, 
ZSIMPERIUMKEY VARCHAR, 
ZCOMPLETED_ACTIONS VARCHAR, 
ZCONTENT VARCHAR, 
ZLAST_ACTION VARCHAR, 
ZTAGS VARCHAR, 
ZUUID VARCHAR );
...
select z_created_at, z_content from zspmanagedobject;

produces the time-stamped draft notes, including notes that were deleted.
451329756.316168|supermarket notes, 2015: I find the selection of shaped,
filled, fried, baked, toasted, flavored, seasoned corn products entirely 
inadequate for a healthy diet.
451357888.003267|"what about the duck?"
"extra crispy!!"
-- looney tunes back in action

No comments: