17 lines
378 B
Markdown
17 lines
378 B
Markdown
- Add possibility to define database custom data types
|
|
|
|
Example usage:
|
|
|
|
```typescript
|
|
const customText = customType<{ data: string }>({
|
|
dataType() {
|
|
return 'text';
|
|
},
|
|
});
|
|
|
|
const usersTable = pgTable('users', {
|
|
name: customText('name').notNull(),
|
|
});
|
|
```
|
|
|
|
For more examples please check [docs](https://github.com/drizzle-team/drizzle-orm/blob/main/docs/custom-types.lite.md) |