File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ function uuid(version: Int?): String {
94
94
/* *
95
95
* Generates a globally unique identifier based on the CUID spec.
96
96
*/
97
- function cuid(): String {
97
+ function cuid(version: Int ? ): String {
98
98
} @@@expressionContext([DefaultValue])
99
99
100
100
/* *
@@ -103,6 +103,12 @@ function cuid(): String {
103
103
function nanoid(length: Int ?): String {
104
104
} @@@expressionContext([DefaultValue])
105
105
106
+ /* *
107
+ * Generates an identifier based on the ulid spec.
108
+ */
109
+ function ulid(): String {
110
+ } @@@expressionContext([DefaultValue])
111
+
106
112
/* *
107
113
* Creates a sequence of integers in the underlying database and assign the incremented
108
114
* values to the ID values of the created records based on the sequence.
Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ describe('Prisma generator test', () => {
164
164
x String @default(nanoid())
165
165
y String @default(dbgenerated("gen_random_uuid()"))
166
166
z String @default(auth().id)
167
+ cuid String @default(cuid())
168
+ cuid2 String @default(cuid(2))
169
+ ulid String @default(ulid())
167
170
}
168
171
` ) ;
169
172
@@ -183,6 +186,9 @@ describe('Prisma generator test', () => {
183
186
expect ( content ) . toContain ( '@default(nanoid())' ) ;
184
187
expect ( content ) . toContain ( '@default(dbgenerated("gen_random_uuid()"))' ) ;
185
188
expect ( content ) . not . toContain ( '@default(auth().id)' ) ;
189
+ expect ( content ) . toContain ( '@default(cuid())' ) ;
190
+ expect ( content ) . toContain ( '@default(cuid(2))' ) ;
191
+ expect ( content ) . toContain ( '@default(ulid())' ) ;
186
192
} ) ;
187
193
188
194
it ( 'triple slash comments' , async ( ) => {
You can’t perform that action at this time.
0 commit comments