classCreateServer
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.
$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> $optionspublic Name $namepublic Name $wrapperMethods§
public function __construct(
public Name $name,
public Name $wrapper,
list<ServerOption> $options,
)Parameters
$name | Name | The server name |
$wrapper | Name | The wrapper name |
$options | list<ServerOption> | The options in written order; at least one |
Throws
InvalidConstruction When there is no optionCalls 2
- static-call Check::listOf() line 49
- class-const ServerOption::class() line 49
public function deriveStatement(Derivation $derivation): voidHas nothing to derive: a server is no relation.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 64
- class-const NameUse::Identifier() line 64
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateServerTestcalls