Directories

    YDB CLI supports operations to change the directory structure and to access schema objects by their directory name.

    The command creates the directories:

    where [connection options] are database connection options

    In the path parameter, specify the relative path to the directory being created, from the root database directory. This command creates all the directories that didn’t exist at the path when the command was called.

    If the destination directory had already existed at the path, then the command execution will be completed successfully (result code 0) with a warning that no changes have been made:

    1. Status: SUCCESS
    2. Issues:
    3. <main>: Error: dst path fail checks, path: /<database>/<path>: path exist, request accepts it,

    Directories - 图2

    Examples:

    • Creating a directory at the database root

    The scheme rmdir command deletes a directory:

    Directories - 图5

    In the path parameter, specify the relative path to the directory to be deleted. This directory must not contain objects (including tables and subdirectories), otherwise the command will fail with an error:

    1. Issues:
    2. <main>: Error: path table fail checks, path: /<database>/<path>: path has children, request
    3. doesn't accept it, pathId: [OwnerId: <some>, LocalPathId: <some>], path type:
    4. EPathTypeDir, path state: EPathStateNoChanges, alive children: <count>

    In all CLI commands to which the object name is passed by the parameter, it can be specified with a directory, for example, in :

    Directories - 图7

    The scheme ls command supports passing the path to the directory as a parameter:

    Names of objects issued in queries may contain a path to the object directory. This path will be concatenated with the path prefix from the TablePathPrefix pragma. If the pragma is omitted, the object name is resolved relative to the database root.