final class PgSqlCopySupport
    implements CopySupport

Copy support for PostgreSQL queries.

Methods§

public function tableName(string $relation): string

Resolves the unqualified table name selected by the COPY arguments.

Parameters

$relationstring

Returns

string
Test cases 1
Calls 3
public function target(
    string $relation,
    ?string $fields,
    TableDefinition $definition,
): CopyTarget

Resolves COPY relation and column arguments against the reflected schema.

Parameters

$relationstring
$fields?string
$definitionTableDefinition

Returns

Throws

ValueError
Test cases 2
Calls 5
public function selectSql(CopyTarget $target): string

Builds the SELECT statement that supplies COPY output rows.

Parameters

$targetCopyTarget

Returns

string
Test cases 2
Calls 4
public function insertSql(CopyTarget $target, int $rowCount, bool $overrideSystemValue): string

Builds the INSERT statement for one decoded COPY input row.

Parameters

$targetCopyTarget
$rowCountint
$overrideSystemValuebool

Returns

string

Throws

ValueError
Test cases 1
Calls 6
public function isCopyStatement(string $sql): bool

Recognizes PostgreSQL COPY statements.

Parameters

$sqlstring

Returns

bool
Test cases 1
Calls 2
public function encodeRow(list<mixed> $values, string $separator, string $nullAs): string

Parameters

$valueslist<mixed>
$separatorstring
$nullAsstring

Returns

string

Throws

ValueError
Test cases 2
Calls 14
public function decodeRow(string $row, string $separator, string $nullAs): list<string|null>

Test cases 12§

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

Dedicated tests 11
Other tests reaching this symbol 1

Relations§

Instantiated in 1