\n", pgno)
+ fmt.Fprintf(writer, "| CELL |
\n")
+ for i := 0; i < cellN; i++ {
+ cell := readLeafCell(b, i)
+ switch cell.Type {
+ case ContainerTypeArray:
+ //fmt.Fprintf(os.Stderr, "[%d]: key=%d type=array n=%d elems=%v\n", i, cell.Key, cell.N, toArray16(cell.Data))
+ fmt.Fprintf(writer, "| [%d]: key=%d type=array n=%d |
\n", i, cell.Key, cell.N)
+ case ContainerTypeRLE:
+ fmt.Fprintf(writer, "| [%d]: key=%d type=rle n=%d |
\n", i, cell.Key, cell.N)
+ default:
+ fmt.Fprintf(writer, "| [%d]: key=%d type=unknown<%d> n=%d |
\n", i, cell.Key, cell.Type, cell.N)
+ }
+ }
+ fmt.Fprintf(writer, "
>]\n")
+ fmt.Fprintf(writer, "%s -> cell%d\n", parent, pgno)
+ default:
+ //should not happen
+ fmt.Fprintf(writer, "==!PAGE %d flags=%d\n", pgno, flags)
+ }
+}
+
+// dumpdot recursively writes the tree representation starting from a given page to STDERR.
+func dumpdot(tx *Tx, pgno uint32, parent string, writer io.Writer) {
+ page, err := tx.readPage(pgno)
+ if err != nil {
+ panic(err)
+ }
+
+ if IsMetaPage(page) {
+ //fmt.Fprintf(writer, "META(%d)\n", pgno)
+ //fmt.Fprintf(writer, "└──