final class GetFormat
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A call of GET_FORMAT(kind, standard): a format string for DATE_FORMAT and STR_TO_DATE.

Rule: MYSQL-GET-FORMAT-001. The result is a character string; it is NULL for a standard name the server does not know. Terminates: the operand is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_get-format. Status: Implemented.

Typing GET_FORMAT()doctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT GET_FORMAT(DATE, 'EUR')");
    $query->field(0)->type->descriptor->name() // => 'VARCHAR'

Properties§

public TemporalFormat $format
public Scalar $standard

Methods§

public function __construct(public TemporalFormat $format, public Scalar $standard)

Parameters

$formatTemporalFormatThe kind of value
$standardScalarThe name of the standard
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand; the result is a character string.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 4
public function render(Output $out): void

Writes the call.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 3§

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

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 1