diff --git a/changelogs/drizzle-orm/0.28.3.md b/changelogs/drizzle-orm/0.28.3.md index 5be0c2474..09f4bd702 100644 --- a/changelogs/drizzle-orm/0.28.3.md +++ b/changelogs/drizzle-orm/0.28.3.md @@ -7,8 +7,11 @@ You can specify any logic and any implementation for a function like `cuid()` fo > Note: This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm` ```ts -const test = mysqlTable('test', { - id: text('id').$defaultFn(() => cuid()), +import { text, mysqlTable } from "drizzle-orm/mysql-core"; +import { createId } from '@paralleldrive/cuid2'; + +const table = mysqlTable('table', { + id: varchar('id', { length: 128 }).$defaultFn(() => createId()), }); ``` @@ -17,6 +20,8 @@ const test = mysqlTable('test', { - 🛠 Deprecated `InferModel` type in favor of more explicit `InferSelectModel` and `InferInsertModel` ```ts +import { InferSelectModel, InferInsertModel } from 'drizzle-orm' + const usersTable = pgTable('users', { id: serial('id').primaryKey(), name: text('name').notNull(), @@ -25,11 +30,11 @@ const usersTable = pgTable('users', { createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(), }); -type SelectUser = usersTable.$inferSelect -type InsertUser = usersTable.$inferInsert +type SelectUser = typeof usersTable.$inferSelect; +type InsertUser = typeof usersTable.$inferInsert; -type SelectUser2 = InferSelectModel -type InsertUser2 = InferInsertModel +type SelectUser2 = InferSelectModel; +type InsertUser2 = InferInsertModel; ``` - 🛠 Disabled `.d.ts` files bundling