Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

durationBetween

  • durationBetween<s>(startInclusive: Col<s, Instant>, endExclusive: Col<s, Instant>): Col<s, Duration>
  • The duration between two Instants.

    SQL equivilent: -

    Type parameters

    • s

    Parameters

    • startInclusive: Col<s, Instant>
    • endExclusive: Col<s, Instant>

    Returns Col<s, Duration>

durationCol

  • durationCol<s>(val: Duration): Col<s, Duration>
  • Type parameters

    • s

    Parameters

    • val: Duration

    Returns Col<s, Duration>

durationDivide

  • durationDivide<s>(lhs: Col<s, Duration>, rhs: Col<s, number>): Col<s, Duration>
  • SQL equivilent: /

    Type parameters

    • s

    Parameters

    • lhs: Col<s, Duration>
    • rhs: Col<s, number>

    Returns Col<s, Duration>

durationMinus

  • durationMinus<s>(lhs: Col<s, Duration>, rhs: Col<s, Duration>): Col<s, Duration>
  • SQL equivilent: -

    Type parameters

    • s

    Parameters

    • lhs: Col<s, Duration>
    • rhs: Col<s, Duration>

    Returns Col<s, Duration>

durationMultiply

  • durationMultiply<s>(lhs: Col<s, Duration>, rhs: Col<s, number>): Col<s, Duration>
  • SQL equivilent: *

    Type parameters

    • s

    Parameters

    • lhs: Col<s, Duration>
    • rhs: Col<s, number>

    Returns Col<s, Duration>

durationParser

  • durationParser(interval: string): Duration
  • This should be used with great care, or ideally avoided

    Parameters

    • interval: string

    Returns Duration

durationPlus

  • durationPlus<s>(lhs: Col<s, Duration>, rhs: Col<s, Duration>): Col<s, Duration>
  • SQL equivilent: +

    Type parameters

    • s

    Parameters

    • lhs: Col<s, Duration>
    • rhs: Col<s, Duration>

    Returns Col<s, Duration>

expandTolocalDateTime

  • expandTolocalDateTime<s>(localDate: Col<s, LocalDate>): Col<s, LocalDateTime>
  • Convert a LocalDate to a LocalDateTime. The time will be set to "00:00:00"

    SQL equivilent: CAST

    Type parameters

    • s

    Parameters

    • localDate: Col<s, LocalDate>

    Returns Col<s, LocalDateTime>

instantAdd

  • instantAdd<s>(instant: Col<s, Instant>, duration: Col<s, Duration>): Col<s, Instant>
  • Add a Duration to an Instant

    SQL equivilent: +

    Type parameters

    • s

    Parameters

    • instant: Col<s, Instant>
    • duration: Col<s, Duration>

    Returns Col<s, Instant>

instantCol

  • instantCol<s>(val: Instant): Col<s, Instant>
  • Type parameters

    • s

    Parameters

    • val: Instant

    Returns Col<s, Instant>

instantParser

  • instantParser(val: string): Instant
  • Parameters

    • val: string

    Returns Instant

instantSubtract

  • instantSubtract<s>(instant: Col<s, Instant>, duration: Col<s, Duration>): Col<s, Instant>
  • Subtract a Duration from an Instant

    SQL equivilent: -

    Type parameters

    • s

    Parameters

    • instant: Col<s, Instant>
    • duration: Col<s, Duration>

    Returns Col<s, Instant>

instantToLocalDateTime

  • instantToLocalDateTime<s>(instant: Col<s, Instant>, timezone: Col<s, string>): Col<s, LocalDateTime>
  • When instant occurred, what time did the clocks on the wall located in timezone show? (Or what do we predict them to show, if instant is in the future?)

    SQL equivilent: TIMEZONE

    Type parameters

    • s

    Parameters

    • instant: Col<s, Instant>
    • timezone: Col<s, string>

    Returns Col<s, LocalDateTime>

localDateAdd

  • localDateAdd<s>(localDate: Col<s, LocalDate>, period: Col<s, Period>): Col<s, LocalDate>
  • Add a Period to a LocalDate

    SQL equivilent: +

    Type parameters

    • s

    Parameters

    • localDate: Col<s, LocalDate>
    • period: Col<s, Period>

    Returns Col<s, LocalDate>

localDateAddDays

  • localDateAddDays<s>(localDate: Col<s, LocalDate>, days: Col<s, number>): Col<s, LocalDate>
  • Add n days to a LocalDate.

    This is similar to localDateAdd, but can be more convenient when the days you want to add is from some other column, or is a computed value.

    SQL equivilent: + (INTEGER)

    Type parameters

    • s

    Parameters

    • localDate: Col<s, LocalDate>
    • days: Col<s, number>

    Returns Col<s, LocalDate>

localDateCol

  • localDateCol<s>(val: LocalDate): Col<s, LocalDate>
  • Type parameters

    • s

    Parameters

    • val: LocalDate

    Returns Col<s, LocalDate>

localDateParser

  • localDateParser(val: string): LocalDate
  • Parameters

    • val: string

    Returns LocalDate

localDateSubtract

  • localDateSubtract<s>(localDate: Col<s, LocalDate>, period: Col<s, Period>): Col<s, LocalDate>
  • Subtract a Period from a LocalDate

    SQL equivilent: -

    Type parameters

    • s

    Parameters

    • localDate: Col<s, LocalDate>
    • period: Col<s, Period>

    Returns Col<s, LocalDate>

localDateSubtractDays

  • localDateSubtractDays<s>(localDate: Col<s, LocalDate>, days: Col<s, number>): Col<s, LocalDate>
  • Subtract n days from a LocalDate.

    This is similar to localDateSubtract, but can be more convenient when the days you want to subtract is from some other column, or is a computed value.

    SQL equivilent: - (INTEGER)

    Type parameters

    • s

    Parameters

    • localDate: Col<s, LocalDate>
    • days: Col<s, number>

    Returns Col<s, LocalDate>

localDateTimeAdd

  • localDateTimeAdd<s>(localDateTime: Col<s, LocalDateTime>, duration: Col<s, Duration>): Col<s, LocalDateTime>
  • localDateTimeAdd<s>(localDateTime: Col<s, LocalDateTime>, period: Col<s, Period>): Col<s, LocalDateTime>
  • Add a Duration to a LocalDateTime

    SQL equivilent: +

    Type parameters

    • s

    Parameters

    • localDateTime: Col<s, LocalDateTime>
    • duration: Col<s, Duration>

    Returns Col<s, LocalDateTime>

  • Add a Period to a LocalDateTime.

    SQL equivilent: +

    Type parameters

    • s

    Parameters

    • localDateTime: Col<s, LocalDateTime>
    • period: Col<s, Period>

    Returns Col<s, LocalDateTime>

localDateTimeCol

  • localDateTimeCol<s>(val: LocalDateTime): Col<s, LocalDateTime>
  • Type parameters

    • s

    Parameters

    • val: LocalDateTime

    Returns Col<s, LocalDateTime>

localDateTimeParser

  • localDateTimeParser(val: string): LocalDateTime
  • Parameters

    • val: string

    Returns LocalDateTime

localDateTimeSubtract

  • localDateTimeSubtract<s>(localDateTime: Col<s, LocalDateTime>, duration: Col<s, Duration>): Col<s, LocalDateTime>
  • localDateTimeSubtract<s>(localDateTime: Col<s, LocalDateTime>, period: Col<s, Period>): Col<s, LocalDateTime>
  • Subtract a Duration from a LocalDateTime

    SQL equivilent: -

    Type parameters

    • s

    Parameters

    • localDateTime: Col<s, LocalDateTime>
    • duration: Col<s, Duration>

    Returns Col<s, LocalDateTime>

  • Subtract a Period from a LocalDateTime

    SQL equivilent: -

    Type parameters

    • s

    Parameters

    • localDateTime: Col<s, LocalDateTime>
    • period: Col<s, Period>

    Returns Col<s, LocalDateTime>

localDateTimeToInstant

  • localDateTimeToInstant<s>(localDateTime: Col<s, LocalDateTime>, timezone: Col<s, string>): Col<s, Instant>
  • When the clocks in timezone showed the given time, what was the instant? (Or what do we predict it to be, if the clocks haven't yet showed this time)

    Note: If due to daylight savings time, the clocks in timezone showed the given time on two seperate instances, then PostgreSQL sill arbitrarily pick one. Similarly, if the clocks in timezone never showed the given time, then PostgreSQL will pick an appropriately close instant.

    SQL equivilent: TIMEZONE

    Type parameters

    • s

    Parameters

    • localDateTime: Col<s, LocalDateTime>
    • timezone: Col<s, string>

    Returns Col<s, Instant>

localTimeAdd

  • localTimeAdd<s>(localTime: Col<s, LocalTime>, duration: Col<s, Duration>): Col<s, LocalTime>
  • Add a Duration to a LocalTime. If the LocalTime overflows (goes past midnight) then the result will wrap around.

    SQL equivilent: +

    Type parameters

    • s

    Parameters

    • localTime: Col<s, LocalTime>
    • duration: Col<s, Duration>

    Returns Col<s, LocalTime>

localTimeCol

  • localTimeCol<s>(val: LocalTime): Col<s, LocalTime>
  • Type parameters

    • s

    Parameters

    • val: LocalTime

    Returns Col<s, LocalTime>

localTimeParser

  • localTimeParser(val: string): LocalTime
  • Parameters

    • val: string

    Returns LocalTime

localTimeSubtract

  • localTimeSubtract<s>(localTime: Col<s, LocalTime>, duration: Col<s, Duration>): Col<s, LocalTime>
  • Subtract a Duration from a LocalTime. If the LocalTime overflows (goes before midnight) then the result will wrap around.

    SQL equivilent: -

    Type parameters

    • s

    Parameters

    • localTime: Col<s, LocalTime>
    • duration: Col<s, Duration>

    Returns Col<s, LocalTime>

periodBetween

  • periodBetween<s>(startDate: Col<s, LocalDate>, endDate: Col<s, LocalDate>): Col<s, Period>
  • The Period between two LocalDates.

    SQL equivilent: age

    Type parameters

    • s

    Parameters

    • startDate: Col<s, LocalDate>
    • endDate: Col<s, LocalDate>

    Returns Col<s, Period>

periodCol

  • periodCol<s>(val: Period): Col<s, Period>
  • Type parameters

    • s

    Parameters

    • val: Period

    Returns Col<s, Period>

periodParser

  • periodParser(interval: string): Period
  • Warning: This is lossy. Only use if you really know what you doing

    Parameters

    • interval: string

    Returns Period

truncateToLocalDate

  • truncateToLocalDate<s>(localDateTime: Col<s, LocalDateTime>): Col<s, LocalDate>
  • Convert a LocalDateTime to a LocalDate (discarding the time portion)

    SQL equivilent: CAST

    Type parameters

    • s

    Parameters

    • localDateTime: Col<s, LocalDateTime>

    Returns Col<s, LocalDate>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc