interface CopySupport

How a dialect writes COPY, where it has one at all.

COPY moves rows in and out of a table without a statement per row, so simulating it means knowing how the rows are written, how they are read back, and what the statement is written against.

Methods§

public function tableName(string $relation): string

Table name.

Parameters

$relationstring

Returns

string
public function target(
    string $relation,
    ?string $fields,
    TableDefinition $definition,
): CopyTarget

Target.

Parameters

$relationstring
$fields?string
$definitionTableDefinition

Returns

public function selectSql(CopyTarget $target): string

Select sql.

Parameters

$targetCopyTarget

Returns

string
public function insertSql(CopyTarget $target, int $rowCount, bool $overrideSystemValue): string

Insert sql.

Parameters

$targetCopyTarget
$rowCountint
$overrideSystemValuebool

Returns

string
public function encodeRow(list<mixed> $values, string $separator, string $nullAs): string

Parameters

$valueslist<mixed>
$separatorstring
$nullAsstring

Returns

string
public function decodeRow(string $row, string $separator, string $nullAs): list<string|null>

Parameters

$rowstring
$separatorstring
$nullAsstring

Returns

list<string|null>
public function isCopyStatement(string $sql): bool

Reports whether copy statement.

Parameters

$sqlstring

Returns

bool

Test cases 2§

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

Other tests reaching this symbol 2

Relations§

Implemented by 1
Type declarations 3