dolthub / dolt

Dolt – Git for Data
Apache License 2.0
17.94k stars 511 forks source link

Create server setting to auto-create branches on connect #2460

Open zachmu opened 2 years ago

zachmu commented 2 years ago

Should be possible to connect to mydb/newBranch without creating that branch first.

timsehn commented 2 years ago
test-commit-diff $ mysql -h 127.0.0.1 --database='test_commit_diff/foo' -u root
ERROR 1105 (HY000): unknown error: database not found: test_commit_diff/foo
test-commit-diff $ mysql -h 127.0.0.1 --database='test_commit_diff/main' -u root
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.9-Vitess 

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

The first command should work and just create the foo branch off HEAD of default branch.

zachmu commented 1 year ago

Slight variation: should be possible to name a remote to automatically pull branches from on connection if they don't exist locally.

This is already the case for read replicas, but would be nice to support on normal clones as well.