Skip to content

monolayer-pg / schema / timetz

Function: timetz()

timetz(precision?): PgTimeWithTimeZone

Column that stores times of day (no date) with time zone.

Parameters

ParameterTypeDescription
precision?DateTimePrecisionNumber of fractional digits retained in the seconds field. The allowed range is from 0 to 6.

Returns

PgTimeWithTimeZone

Remarks

Without precision specified, there is no explicit bound on precision.

Kysely database schema type definition

ts
{
  readonly __select__: string | null;
  readonly __insert__: string | null | undefined;
  readonly __update__: string | null;
};

Nullability and optionality will change according to the column's constraints, generated values, and default data values.

Example

ts
import { schema, table, timetz } from "@monolayer/pg/schema";

const dbSchema = schema({
  tables: {
    example: table({
      columns: {
        start: timetz(),
      },
    }),
  },
});

// Kysely database schema type
type DB = typeof dbSchema.infer;

See

time with time zone (PostgreSQL Docs)