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

A request to define how a user connects to a foreign server.

Rule: PG-USER-MAPPING-001. Mirrors CreateUserMappingStmt. The user is a role specification or the keyword USER, which designates the current user. Source: https://www.postgresql.org/docs/17/sql-createusermapping.html. Status: Implemented.

Reading a user mappingdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE USER MAPPING FOR USER SERVER s OPTIONS (user 'bob')");
    [$operation->statement->user, $operation->statement->options[0]->value->value] // => [\SqlSemantics\Platform\PostgreSql\Statement\Catalog\ForeignData\MappingUser::User, 'bob']

Properties§

public list<GenericOption> $options
public bool $ifNotExists
public Name $server

Methods§

public function __construct(
    public bool $ifNotExists,
    public RoleSpec|MappingUser $user,
    public Name $server,
    list<GenericOption> $options = [],
)

Parameters

$ifNotExistsboolWhether IF NOT EXISTS is written
$userRoleSpec|MappingUserThe user
$serverNameThe foreign server
$optionslist<GenericOption>The options
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives nothing: a user mapping is not part of a declaration context.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 4

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 2