final class CloneInstance
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CLONE INSTANCE FROM user@host:port IDENTIFIED BY 'password' [DATA DIRECTORY [=] 'directory'] [REQUIRE [NO] SSL]: a request to clone a remote server (MySQL 8.0.17 and later).

Mirrors Sql_cmd_clone for a remote clone. Rule: MYSQL-CLONE-INSTANCE-001. The account, the colon and the port are written without spaces: the server rejects a space around the colon as a syntax error. Without a directory the clone replaces the data of the local server; without an SSL choice the server's clone_ssl settings decide. The equals sign is optional and not written. The statement names no relation and has no facts. Source: https://dev.mysql.com/doc/refman/8.4/en/clone.html. Status: Implemented.

Cloning a remote server into a directorydoctest
$clone = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("clone instance from 'u'@'h':3306 identified by 'p' data directory '/d' require no ssl");
    [$clone->toString(), $clone->statement->port->text, $clone->statement->requireSsl] // => ["CLONE INSTANCE FROM u@h:3306 IDENTIFIED BY 'p' DATA DIRECTORY '/d' REQUIRE NO SSL", '3306', false]

Properties§

public Account $donor
public Numeral $port
public Text $password
public Text|null $directory = null
public bool|null $requireSsl = null

Methods§

public function __construct(
    public Account $donor,
    public Numeral $port,
    public Text $password,
    public Text|null $directory = null,
    public bool|null $requireSsl = null,
)

Parameters

$donorAccountThe account the clone connects as, with the donor's host
$portNumeralThe donor's port
$passwordTextThe account's password
$directoryText|nullThe directory the data is cloned into, when written
$requireSslbool|nullWhether REQUIRE SSL (true) or REQUIRE NO SSL (false) is written; null when absent
public function deriveStatement(Derivation $derivation): void

Has nothing to derive: the request names no relation and no value.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 1

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 1