classAtLocal
final class AtLocal
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.A time converted to or from the session time zone: a AT LOCAL (PostgreSQL 17).
The parser reads it as a call of pg_catalog.timezone(a).
Rule: PG-AT-LOCAL-001. Facts: those of PG-AT-TIME-ZONE-001 with a text zone; the value depends on the session's TimeZone setting, not its type. The operand must keep its place (PG-PRECEDENCE-001). Source: https://www.postgresql.org/docs/17/functions-datetime.html#FUNCTIONS-DATETIME-ZONECONVERT. Status: Implemented.
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("SELECT '2024-01-01 00:00'::timestamp AT LOCAL", [])->field(0)->type->descriptor->name() // => 'timestamp with time zone'Properties§
public Scalar $operandMethods§
public function __construct(public Scalar $operand)Parameters
$operand | Scalar | The time value |
Calls 4
- static-call Check::input() line 42
- method-call Precedence::before() line 42
- new Precedence line 42
- class-const Precedence::AT() line 42
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the operand and the converted type.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 6
- method-call Derivation::scalar() line 50
- new ScalarFact line 52
- method-call PredicateTyping::zone() line 52
- new PredicateTyping line 52
- new Known line 52
- class-const Builtin::Text() line 52
public function render(Output $out): voidWrites the value and AT LOCAL.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::node() line 60
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.