dolt
dolt copied to clipboard
`dolt sql` and other commands should connect to running database
It's not safe to issue CLI commands to update a database while a server is running. To prevent issues this might cause, we made any command that updates database state fail if a server is running. This makes the command line much less useful.
Instead of locking the database when a server is running, we should implement the following:
- Implement all
dolt
CLI commands as SQL commands - Make
dolt
automatically connect to appropriate running server to issue its command - If no server is running, the command behaves exactly as if the command started a server, issued the single command, and quit the server.
- The command line client is a single long-term session that persists between database invocations
This design necessarily also resolves odd differences in behavior between running a command and issuing its equivalent SQL statement.
We can make this change incrementally, but we shouldn't write new commands or make major changes to existing ones without considering this design.
Makes sense to me. I love unifying on the sql path and cleaning up the duplicated logic in the CLI commands.
The only downside I could brainstorm was that starting a server will slow down some of the CLI commands, but that seems negligible for a command line experience.
As you can see, this is heavily in progress.
Resoving this uber issue as we have sub issues for the commands that don't now.