dolt
dolt copied to clipboard
Support `dolt read-tables` for DoltHub remotes. Fix the error message which says new format.
$ dolt read-tables --dir ../new-db origin main
Dolt command 'read-tables' is not supported in format __DOLT__
Damn you @andy-wm-arthur and @druvv .
Unclear how this is passing:
https://github.com/dolthub/dolt/blob/698c9ce2230e1978d6dd44e2580de1cf4cfbe148/integration-tests/bats/remotes.bats#L573
So starting from a fresh database and remote works.
$ cd test_read_tables
$ dolt init --fun
Successfully initialized dolt data repository.
$ dolt sql <<SQL
CREATE TABLE test (
pk BIGINT NOT NULL COMMENT 'tag:0',
c1 BIGINT COMMENT 'tag:1',
c2 BIGINT COMMENT 'tag:2',
c3 BIGINT COMMENT 'tag:3',
c4 BIGINT COMMENT 'tag:4',
c5 BIGINT COMMENT 'tag:5',
PRIMARY KEY (pk)
);
SQL
$ dolt ls
Tables in working set:
test
$ dolt add test
$ dolt commit -am "test commit"
commit pr1fqv2i643rbroq0hg61p9dgihtcobe (HEAD -> main)
Author: timsehn <[email protected]>
Date: Wed May 31 15:32:09 -0700 2023
test commit
$ mkdir ../remote_for_read_tables
$ dolt remote add test-remote file:///Users/timsehn/dolthub/dolt/remote_for_read_tables
$ dolt push
Uploaded 1.5 kB of 1.5 kB @ 0 B/s.
$ ls -al ../remote_for_read_tables
total 24
drwxr-xr-x 7 timsehn staff 224 May 31 15:36 .
drwxr-xr-x 33 timsehn staff 1056 May 31 15:35 ..
-rw------- 1 timsehn staff 321 May 31 15:36 1cbftjjd4t0mi7k7d3kg8i2uihtop22e
-rw------- 1 timsehn staff 1493 May 31 15:36 5tc639mu6mtghvir0sg7j6gfhjaimf4g
-rw------- 1 timsehn staff 0 May 31 15:36 LOCK
-rw------- 1 timsehn staff 179 May 31 15:36 manifest
drwxr-xr-x 2 timsehn staff 64 May 31 15:35 oldgen
$ dolt read-tables --dir tables_are_read file:///Users/timsehn/dolthub/dolt/remote_for_read_tables main
cloning file:///Users/timsehn/dolthub/dolt/remote_for_read_tables
Retrieving test
Downloaded 2 chunks, 564 B @ 0 B/s.
$ cd tables_are_read
$ dolt ls
Tables in working set:
test
$
Which is why bats works.
It looks like this is only DoltHub remotes:
$ dolt remote -v
origin https://doltremoteapi.dolthub.com/timsehn/sql_alchemy_demo
$ dolt read-tables --dir tables_are_read_from_remote_alias origin main
Dolt command 'read-tables' is not supported in format __DOLT__
$ dolt read-tables --dir tables_are_read_from_remote_url https://doltremoteapi.dolthub.com/timsehn/sql_alchemy_demo main
Dolt command 'read-tables' is not supported in format __DOLT__