Skip to content

Commit

Permalink
add length option to nanoid
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasburk committed Dec 9, 2024
1 parent de87215 commit ff9525f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/200-orm/500-reference/100-prisma-schema-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3150,7 +3150,7 @@ model User {

### `nanoid()`

Generated values based on the [Nano ID](https://github.com/ai/nanoid) spec. `nanoid()` also accepts an integer value that indicates the target _length_ of the generated ID value, e.g. `nanoid(16)`. The default value is `21`.
Generated values based on the [Nano ID](https://github.com/ai/nanoid) spec. `nanoid()` accepts an integer value between 2 and 255 that specifies the _length_ of the generated ID value, e.g. `nanoid(16)` will generated ID with 16 characters. If you don't provide a value to the nanoid() function, the default value is 21.

:::info

Expand All @@ -3173,7 +3173,7 @@ There are two main differences between Nano ID and UUID v4:

#### Examples

##### Generate `nanoid()` values (with 21 characters) as IDs
##### Generate `nanoid()` values with 21 characters as IDs

<TabbedContent code>
<TabItem value="Relational databases">
Expand All @@ -3198,7 +3198,7 @@ model User {
</TabItem>
</TabbedContent>

##### Generate `nanoid()` values (with 16 characters) as IDs
##### Generate `nanoid()` values with 16 characters as IDs

<TabbedContent code>
<TabItem value="Relational databases">
Expand Down

0 comments on commit ff9525f

Please sign in to comment.