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

A request to define a foreign-data wrapper.

Rule: PG-FDW-001. Mirrors CreateFdwStmt: name, handler and validator clauses in the order written, and options. A handler or validator named twice is a diagnostic (PG-FOREIGN-OPTION-001). Source: https://www.postgresql.org/docs/17/sql-createforeigndatawrapper.html. Status: Implemented.

Reading the handler of a wrapperdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE FOREIGN DATA WRAPPER w HANDLER h NO VALIDATOR OPTIONS (debug 'true')");
    [$operation->statement->functions[0]->function?->last()->value, $operation->toString()] // => ['h', "CREATE FOREIGN DATA WRAPPER w HANDLER h NO VALIDATOR OPTIONS (debug 'true')"]

Properties§

public list<FunctionClause> $functions
public list<GenericOption> $options
public Name $name

Methods§

public function __construct(
    public Name $name,
    list<FunctionClause> $functions = [],
    list<GenericOption> $options = [],
)

Parameters

$nameNameThe wrapper name
$functionslist<FunctionClause>The handler and validator clauses in the order written
$optionslist<GenericOption>The options
Calls 3
public function deriveStatement(Derivation $derivation): void

Reports a function role named twice.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 5

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