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

CREATE SERVER name FOREIGN DATA WRAPPER wrapper OPTIONS (option, …): a request to define a server for the FEDERATED engine.

Mirrors SQLCOM_CREATE_SERVER with Server_options. Rule: MYSQL-CREATE-SERVER-001. The name and the wrapper are written as identifiers or strings; the server compares server names case-insensitively. The options are kept in written order. The statement declares no relation. Source: https://dev.mysql.com/doc/refman/8.4/en/create-server.html. Status: Implemented.

Defining a serverdoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("create server s foreign data wrapper mysql options (host 'db', port 3307)");
    [$create->toString(), $create->statement->options[1]->kind] // => ["CREATE SERVER s FOREIGN DATA WRAPPER mysql OPTIONS (HOST 'db', PORT 3307)", \SqlSemantics\Platform\MySql\Statement\Server\ForeignServer\ServerOptionKind::Port]

Properties§

public list<ServerOption> $options
public Name $name
public Name $wrapper

Methods§

public function __construct(
    public Name $name,
    public Name $wrapper,
    list<ServerOption> $options,
)

Parameters

$nameNameThe server name
$wrapperNameThe wrapper name
$optionslist<ServerOption>The options in written order; at least one

Throws

InvalidConstruction When there is no option
Calls 2
public function deriveStatement(Derivation $derivation): void

Has nothing to derive: a server is no relation.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

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