edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Add REPL backslash commands for branches

Open raddevon opened this issue 1 year ago • 2 comments

We currently have REPL backslash commands for databases. We should add new commands for branches.

Here are some commands that need branch analogs and my proposals for their counterparts:

  • \list databases -> \list branches
  • \database create [name] -> \branch create [name]
  • \c, \connect [dbname] -> \switch [branch-name] and maybe \s?

raddevon avatar Mar 27 '24 13:03 raddevon

One more interesting wrinkle here: we have \l as an alias for \list databases. This gets confusing when some instances have databases and others have branches. Is it possible for the \l shorthand to be adaptive to alias either \list databases or \list branches, whichever is applicable to the current database? This way, if anyone has built up muscle memory around \l, they can continue to use it across any of their instances, regardless of whether those instances have databases or branches.

raddevon avatar Mar 28 '24 13:03 raddevon

I like the approach of \l being version-aware, ex \l databases prints warning in >=5.x server and \l branches prints warning in <5.0

quinchs avatar Apr 04 '24 15:04 quinchs