generalize dbio to support non-file IOs