One way to manually persist a dictionary to a database is to flatten it into a sequence of sequences and pass the sequence as an argument to cursor.executemany().
The opposite is also useful, i.e. reading rows from a database and turning them into dictionaries for later use.
What's the best way to go from myseq to mydict and from mydict to myseq?
>>> myseq = ((0,1,2,3), (4,5,6,7), (8,9,10,11))
>>> mydict = {0: (1, 2, 3), 8: (9, 10, 11), 4: (5, 6, 7)}