final class PgSqlValueRenderer
    implements ValueRenderer
Public API: explicitly declared with @visibility public.

Encodes shadow values using PostgreSQL's typed literal semantics.

Encode boolean valuesdoctest
(new \ZtdQuery\Platform\Postgres\Sql\Value\PgSqlValueRenderer())->renderValue(true) // => 'TRUE'

Methods§

public function __construct(private CastRenderer $castRenderer = new \ZtdQuery\Platform\Postgres\Sql\Value\PgSqlCastRenderer())

Initializes the collaborators and state used by this value renderer.

Parameters

$castRendererCastRenderer
Calls 1
public function renderValue(mixed $value, ?ColumnDeclaration $type = null): string
Public API: explicitly declared with @visibility public.

Renders a shadow value as a PostgreSQL literal, optionally using its declared type.

Parameters

$valuemixed
$type?ColumnDeclaration

Returns

string

Throws

RuntimeException
Render typed strings and null without interpolating data into SQLdoctest
$renderer = new \ZtdQuery\Platform\Postgres\Sql\Value\PgSqlValueRenderer();
    $renderer->renderValue("O'Reilly") // => "CAST('O''Reilly' AS TEXT)"
    $renderer->renderValue(null) // => 'NULL'
Test cases 12
Calls 20

Private surface 1§

Implementation details, listed for orientation only.

private CastRenderer $castRenderer = new \ZtdQuery\Platform\Postgres\Sql\Value\PgSqlCastRenderer()

Test cases 27§

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

Dedicated tests 12
Other tests reaching this symbol 15

Relations§

Instantiated in 1