Node.js Drizzle PostgreSQL timestamptz 带时区的时间戳类型

Drizzle Node.js About 355 words

timestamp()

timestamp({withTimezone: true}),传入withTimezone属性为true

import {integer, pgTable, timestamp} from "drizzle-orm/pg-core";

const posts = pgTable("post", {
    id: integer().primaryKey(),
    createTs: timestamp({withTimezone: true}),
    updateTs: timestamp({withTimezone: true}),
})

官方文档

https://orm.drizzle.team/docs/column-types/pg#timestamp

Views: 24 · Posted: 2025-10-13

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Today In History
Browsing Refresh