-
-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create dolt_help system table #8739
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right idea, but it's missing a few things. Check out the difference between the command line and sql output here:
select arguments from dolt_help where target = 'dolt_add';
+-------------------------------------------------------------------------------------------------------------------------------------+
| arguments |
+-------------------------------------------------------------------------------------------------------------------------------------+
| {"table": "Working table(s) to add to the list tables staged to be committed. The abbreviation '.' can be used to add all tables."} |
+-------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
v. command line:
% dolt add --help
NAME
dolt add - Add table contents to the list of staged tables
SYNOPSIS
dolt add [<table>...]
DESCRIPTION
This command updates the list of tables using the current content found in the working root, to prepare the content staged for the next commit. It adds the current content of existing
tables as a whole or remove tables that do not exist in the working root anymore.
This command can be performed multiple times before a commit. It only adds the content of the specified table(s) at the time the add command is run; if you want subsequent changes
included in the next commit, then you must run dolt add again to add the new content to the index.
The dolt status command can be used to obtain a summary of which tables have changes that are staged for the next commit.
OPTIONS
<table>
Working table(s) to add to the list tables staged to be committed. The abbreviation '.' can be used to add all tables.
-A, --all
Stages any and all changes (adds, deletes, and modifications) except for ignored tables.
-f, --force
Allow adding otherwise ignored tables.
-p, --patch
Interactively select changes to add to the staged set.
So relative to the CLI, this is missing:
- options (flags)
- synopsis
<table>
formatting for arguments
return NewHelpRowIter(), nil | ||
} | ||
|
||
type HelpRowIter struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best practice here is to use a pointer for the receiver type and not the fields
|
||
if hasProcedure && docs != nil { | ||
argsMap := map[string]string{} | ||
for _, argHelp := range curr.Docs().ArgParser.ArgListHelp { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing all the options (flags)
func (ht *HelpTable) Schema() sql.Schema { | ||
return []*sql.Column{ | ||
{ | ||
Name: "target", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would call this name
instead
PrimaryKey: false, | ||
DatabaseSource: ht.dbName, | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want a synopsis
column in here for example usage, like the CLI help
Created the dolt_help system table. This table is meant to store documentation for system tables, procedures, functions, and variables. Currently dolt_help is only populated with documentation for procedures, and only procedures that have equivalent CLI commands.
Part of #7984