Skip to content
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

Add .indexes command #100

Closed
yaziine opened this issue Jun 16, 2020 · 5 comments · Fixed by #129
Closed

Add .indexes command #100

yaziine opened this issue Jun 16, 2020 · 5 comments · Fixed by #129
Labels
cli Command line good first issue Good for newcomers
Milestone

Comments

@yaziine
Copy link
Collaborator

yaziine commented Jun 16, 2020

List all indexes:

genji> .indexes

List indexes of a specific table:

genji> .indexes user
@yaziine yaziine added the cli Command line label Jun 16, 2020
@asdine asdine added this to the v0.7.0 milestone Jun 28, 2020
@asdine asdine added the good first issue Good for newcomers label Jun 28, 2020
@tzzed
Copy link
Contributor

tzzed commented Jul 16, 2020

The behaviour of .indexes command should only list indexes name or returns table index information.
What kind of output is expected? Output json document or Sql row?

@asdine
Copy link
Collaborator

asdine commented Jul 17, 2020

Good question @tzzed, I think it should be the same as with the .tables command: Just a list of names, one per line

@yaziine
Copy link
Collaborator Author

yaziine commented Jul 17, 2020

I think adding the name of the table and the field whose the index is configured to may worth it.

genji> .indexes
idx_bar on user(name)
idx_foo on user(email)

where user is the table and name and email fields of that table.

@asdine
Copy link
Collaborator

asdine commented Jul 17, 2020

I love this idea, let's do it ❤️

@tzzed
Copy link
Contributor

tzzed commented Jul 17, 2020

Agree same as .tables.
What about the refactor of Index struct. Your suggestion leaves this issue out of context about the refactor because json.MarshalIndent(...) is not use.
So should I do an issue to suggest why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Command line good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants