code: def main():
      import io
      import pprint
  
      # Initialize and populate our database.
      conn = sqlite3.connect(":memory:")
      cursor = conn.cursor()
      cursor.execute(
          "CREATE TABLE memos(key INTEGER PRIMARY KEY, task TEXT)"
      )
      tasks = (
          "give food to fish",
          "prepare group meeting",
          "fight with a zebra",
      )
      for task in tasks:
          cursor.execute("INSERT INTO memos VALUES(NULL, ?)", (task,))
  
      # Fetch the records to be pickled.
      cursor.execute("SELECT * FROM memos")
      memos = [MemoRecord(key, task) for key, task in cursor]
      # Save the records using our custom DBPickler.
      file = io.BytesIO()
      DBPickler(file).dump(memos)
  
      print("Pickled records:")
      pprint.pprint(memos)
  
      # Update a record, just for good measure.
      cursor.execute(
          "UPDATE memos SET task='learn italian' WHERE key=1"
      )
  
      # Load the records from the pickle data stream.
      file.seek(0)
      memos = DBUnpickler(file, conn).load()
  
      print("Unpickled records:")
      pprint.pprint(memos)
  
file_path: cpython/Doc/includes/dbpickle.py
imports: import pickle
  import sqlite3
  from collections import namedtuple
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types