dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Need a way to list all dolt system tables in SQL context

Open timsehn opened this issue 3 years ago • 7 comments

us-schools $ dolt ls -a
Tables in working set:
	 schools

System tables:
	 dolt_docs
	 dolt_commit_ancestors
	 dolt_diff_dolt_docs
	 dolt_commit_diff_dolt_docs
	 dolt_conflicts_schools
	 dolt_conflicts
	 dolt_diff_schools
	 dolt_history_dolt_docs
	 dolt_constraint_violations_dolt_docs
	 dolt_commits
	 dolt_status
	 dolt_remotes
	 dolt_constraint_violations_schools
	 dolt_conflicts_dolt_docs
	 dolt_branches
	 dolt_log
	 dolt_constraint_violations
	 dolt_commit_diff_schools
	 dolt_history_schools

A user suggested:

SELECT * from information_schema.tables

Or something similar.

timsehn avatar Aug 30 '21 22:08 timsehn

just encountered the same bug/ feature wish.

in my opinion i would make sense to "display" them like regular tables so that one can view them (eg in tableplus).

at first i was a little bit confused why the system/ dolt tables where not listed, but still available for commands

SHOW tables

until i understood that they exist find but are'nt displayed on them own

alexn-s avatar Jul 24 '22 13:07 alexn-s

Agreed. We need a way to list them but it has to be compatible with MySQL. There are two many of we just put them in show tables. That's why we haven't fixed this yet :-)

timsehn avatar Jul 25 '22 16:07 timsehn

Hi @alexn-s , we'd love to learn what you are using Dolt for. Feel free to swing by Discord or shoot me an email if you'd like to share.

bpf120 avatar Jul 25 '22 17:07 bpf120

@timsehn i understand. for the future with postgres you could add the tables in a different schema (not public) so that the user does not "automatically" see the tables and gets overwhelmed, but are neatly packed in the background (schema name: dolt)

as i just jumped on mysql because of dolt i am not sure/ guess that mysql does not have multiple schemas?

alexn-s avatar Jul 26 '22 05:07 alexn-s

No multiple schemas in MySQL. So, we need another solution :-)

The .dolt schema sounds pure if we could make something like that work.

timsehn avatar Jul 26 '22 15:07 timsehn

We also need this to work for the new Hosted GraphQL service. An idea is to expose the information in INFORMATION_SCHEMA.TABLES. This might allow editors like DataGrip to recognize the dolt system tables as valid tables.

druvv avatar Jul 26 '22 18:07 druvv

Lol I see the above.

druvv avatar Jul 26 '22 18:07 druvv