Skip to content

dolt sql and other commands should connect to running database #3922

@zachmu

Description

@zachmu

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:

  1. Implement all dolt CLI commands as SQL commands
  2. Make dolt automatically connect to appropriate running server to issue its command
  3. If no server is running, the command behaves exactly as if the command started a server, issued the single command, and quit the server.
  4. 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions