Skip to content

Commit

Permalink
Update changelog examples
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiSherman committed Aug 22, 2023
1 parent 0b40e96 commit 8b61a2e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions changelogs/drizzle-orm/0.28.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
});
```

Expand All @@ -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(),
Expand All @@ -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<typeof usersTable>
type InsertUser2 = InferInsertModel<typeof usersTable>
type SelectUser2 = InferSelectModel<typeof usersTable>;
type InsertUser2 = InferInsertModel<typeof usersTable>;
```

- 🛠 Disabled `.d.ts` files bundling
Expand Down

0 comments on commit 8b61a2e

Please sign in to comment.