@postgresql-typed/tzswitcher
v0.3.1
Published
A PostgreSQL-Typed extension to switch the timezone of a column from one to another
Downloads
200
Maintainers
Readme
npm install --save @postgresql-typed/tzswitcher
// pgt.config.ts (or postgresql-typed.config.ts)
import { defineConfig } from "@postgresql-typed/cli/config";
import "@postgresql-typed/tzswitcher/register";
export default defineConfig({
core: {
extensions: [
"@postgresql-typed/tzswitcher",
],
},
// TzSwitcher configuration (All options are optional)
// By default, all the from/to objects are set to false (meaning they won't be switched)
tzswitcher: {
// timestamp/timestamptz/time/timetz columns
timestamp: {
from: "UTC", // The timezone that is stored in the database
to: "Asia/Seoul", // The timezone that you want to switch to locally
},
timestamptz: false, // Disable timestamptz switching
time: {
from: "UTC",
to: "Asia/Seoul",
},
timetz: false,
}
});