dolt
dolt copied to clipboard
Embed cli command in `dolt sql`
It would be really cool is we could invert to control of CLI and SQL Shell. Example:
db4> insert into tbl values (42);
Query OK, 1 row affected (0.00 sec)
mydb> /diff
diff --dolt a/tbl b/tbl
--- a/tbl
+++ b/tbl
+---+----+
| | i |
+---+----+
| + | 42 |
+---+----+
mydb>
The nice thing about this is that the session persists in the connection, so you could run stored procedures or cli commands and they would have the same effect.
Simple prototype. https://github.com/dolthub/dolt/tree/macneale4/slash_bang
It actually surprised me when I was able to commit. I'll attach a screen shot.
This is awesome. But how did you specify the commit message in the example?
I specified no args, so the commit command started my editor, just as it would if executed directly. I was surprised it worked, which is why "whoa" was all I had to say about it