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

Adjusted documentation of tableList command (Java) #1288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clovergaze
Copy link
Contributor

  • provided the correct return type
  • extended the example

Reason for the change
I tried to simply get the list of table names in a database and the current documentation is not helpful in that regard. The specified return type is wrong and the array with table names had to be extracted from the Result<Object>.

Description
I corrected the return type and added a useful example that shows how to really get the table names.

Checklist

* provided the correct return type
* extended the example
@clovergaze
Copy link
Contributor Author

clovergaze commented Sep 12, 2020

This might also be a viable example:

try (Result<Object> result = r.db(DEFAULT_DB_NAME).tableList().run(connection)) {
  result.forEach(list -> {
    ((List<?>) list).forEach(System.out::println);
  });
}

{% endapibody %}

# Description #

List all table names in a database. The result is a list of strings.

__Example:__ List all tables of the 'test' database.
__Example:__ List all tables of the 'test' (`DEFAULT_DB_NAME`) database.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clovergaze why do we need to add the 'DEAULT_DB_NAME? The examples should be copy-paste snippets.

@@ -11,16 +11,19 @@ related_commands:
# Command syntax #

{% apibody %}
db.tableList() &rarr; array
db.tableList() &rarr; TableList
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type should be ReQL type ('array')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants