Liking cljdoc? Tell your friends :D

wagoe.platform.shell.database.timestamp-tz

Widen timestamp columns declared without a timezone to ones that carry it.

A column declared TIMESTAMP stores wall-clock time and no zone, so what it means depends on who reads it. The JVM flag from BOU-431 makes every Wagoe process agree that the zone is UTC, and this makes the column say so itself — so a report, a psql session or another service reads the same moment.

Only PostgreSQL and H2 need it. MySQL's TIMESTAMP already normalises to UTC on the way in and out (its zone-less type is DATETIME), and SQLite has no timezone concept at all — its column types are storage-class affinities.

Idempotent: a column that already carries a zone is left alone, so this is safe to run from a migration and from a boot-time schema check.

Widen timestamp columns declared without a timezone to ones that carry it.

A column declared `TIMESTAMP` stores wall-clock time and no zone, so what it
means depends on who reads it. The JVM flag from BOU-431 makes every Wagoe
process agree that the zone is UTC, and this makes the column say so itself —
so a report, a psql session or another service reads the same moment.

Only PostgreSQL and H2 need it. MySQL's `TIMESTAMP` already normalises to UTC
on the way in and out (its zone-less type is `DATETIME`), and SQLite has no
timezone concept at all — its column types are storage-class affinities.

Idempotent: a column that already carries a zone is left alone, so this is
safe to run from a migration and from a boot-time schema check.
raw docstring

downclj

(down _config _columns)

Nothing. Narrowing a column back would discard the zone it just gained, and the value is the same moment either way.

Nothing. Narrowing a column back would discard the zone it just gained, and
the value is the same moment either way.
sourceraw docstring

upclj

(up config columns)

Migratus entry point. The column list comes from the migration's :up-fn arguments, so each library names its own tables.

Migratus entry point. The column list comes from the migration's `:up-fn`
arguments, so each library names its own tables.
sourceraw docstring

widen-columns!clj

(widen-columns! datasource columns)

Give each [table column] in columns a timezone, where the engine has one.

Returns the number of columns altered. Columns that already carry a zone, and engines that have no such type, are counted as nothing to do.

Give each `[table column]` in `columns` a timezone, where the engine has one.

Returns the number of columns altered. Columns that already carry a zone, and
engines that have no such type, are counted as nothing to do.
sourceraw docstring

zone-aware?clj

(zone-aware? type-name)

Whether type-name is a timestamp that carries a zone.

PostgreSQL spells it timestamptz, H2 TIMESTAMP WITH TIME ZONE.

Whether `type-name` is a timestamp that carries a zone.

PostgreSQL spells it `timestamptz`, H2 `TIMESTAMP WITH TIME ZONE`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close