Skip to content

Tips on using Drizzle ORM #2385

Answered by Romakita
LefanTan asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @LefanTan
I thinks isn't really a problem. It will depend how far you want to go in integrating ORM features with Ts.ED.

For example, drizzle display a showcase with postgre-sql:

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


export const users = pgTable("users", {
  id: serial("id").primaryKey(),
  fullName: text("full_name").notNull(),
  phone: varchar("phone", {length: 20}).notNull(),
  role: text("role", {enum: ["user", "admin"]}).default("user").notNull(),
  cityId: integer("city_id").references(() => cities.id),
  createdAt: timestamp("created_at").defaultNow().notNull(),
  updatedAt: timestamp("…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LefanTan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants