Closed penberg closed 1 month ago
@penberg I'm fairly new to Rust and completely new to limbo (playing with it for the last few hours). I have an approach where I calculate the indent based on the opcode (increase indent after RewindAwait and SorterSort, decrease indent on the same line as NextAsync and SorterNext). With this, I get the following output:
> EXPLAIN SELECT id FROM users;
addr opcode p1 p2 p3 p4 p5 comment
---- ------------- ---- ---- ---- ------------- -- -------
0 Init 0 10 0 0 Start at 10
1 OpenReadAsync 0 2 0 0 root=2
2 OpenReadAwait 0 0 0 0
3 RewindAsync 0 0 0 0
4 RewindAwait 0 9 0 0
5 RowId 0 0 0 0
6 ResultRow 0 1 0 0 output=r[0..1]
7 NextAsync 0 0 0 0
8 NextAwait 0 4 0 0
9 Halt 0 0 0 0
10 Transaction 0 0 0 0
11 Goto 0 1 0 0
If this is the right approach, I can create a PR (code).
Hey @Ramkarthik! Looks reasonable, send a PR!
Limbo:
SQLite: