Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions api/java/manipulating-tables/table_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ related_commands:
# Command syntax #

{% apibody %}
db.tableList() → array
db.tableList() → TableList
{% 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.

```java
r.db("test").tableList().run(conn);
```
List<?> tableList = r.db(DEFAULT_DB_NAME).tableList().run(connection, ArrayList.class).single();

if (tableList != null) {
for(Object tableName : tableList) {
System.out.println(tableName);
}
}
```