SHOW OBJECTS command¶
The SHOW OBJECTS command returns information about the resource objects that are owned by the current user or a specific user.
Persistent objects in schemas that the current user cannot access are omitted, even if the queried user still owns those objects. For more information, see Schema access control.
The following table describes the returned columns:
| Column | Description |
|---|---|
type |
The type of resource object that is owned by the user. Valid values: SCHEMA, GRAPH TYPE, GRAPH, PROCEDURE, and FUNCTION. |
name |
The parent reference and name of the resource object that is owned by the user. |
Prerequisites¶
- Any user can query the resource objects that they own.
- To query resource objects owned by another user, the current user must have
ADMIN.
Syntax¶
- show_objects_command
show_objects_command ::=
'SHOW' 'OBJECTS' ('FOR' 'USER' user_name)?
Parameters¶
FOR¶
Specifies whether to query the objects owned by a specific user.
If the FOR clause is not specified, the command queries the objects owned by the current user by default.
user_name¶
The name of the user whose resource objects are to be queried. To list users who have joined the current service group, use SHOW USERS.
Examples¶
Query the resource objects owned by the current user¶
SHOW OBJECTS
Return:
+------------+----------------------------+
| type | name |
+------------+----------------------------+
| GRAPH_TYPE | /default_schema/movie_type |
| GRAPH | /default_schema/movie |
+------------+----------------------------+
Query the resource objects owned by a specific user¶
'''
ALTER OWNER GRAPH TYPE movie_type TO USER user1 // Change the owner of movie_type to user1
'''
'''
SHOW OBJECTS FOR USER user1
'''
Return:
+------------+----------------------------+
| type | name |
+------------+----------------------------+
| GRAPH_TYPE | /default_schema/movie_type |
+------------+----------------------------+