-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(client,cli): apply dynamic denylist for models with tests (#2589)
- Loading branch information
Showing
8 changed files
with
285 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
datasource my_db { | ||
provider = "sqlite" | ||
url = env("SQLITE_URL") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
output = "@prisma/client" | ||
} | ||
|
||
model Blog { | ||
id Int @id | ||
} | ||
|
||
model public { | ||
id Int @id | ||
} | ||
|
||
model var { | ||
id Int @id | ||
} |
21 changes: 21 additions & 0 deletions
21
src/packages/cli/fixtures/project/subdir/dynamic-denylist.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
datasource my_db { | ||
provider = "sqlite" | ||
url = env("SQLITE_URL") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
output = "@prisma/client" | ||
} | ||
|
||
model Blog { | ||
id Int @id | ||
} | ||
|
||
model BlogClient { | ||
id Int @id | ||
} | ||
|
||
model BlogArgs { | ||
id Int @id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/packages/client/src/__tests__/generation/denylist.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
model public { | ||
id Int @id | ||
} | ||
|
||
model dmmf { | ||
id Int @id | ||
} | ||
|
||
model OnlyOne { | ||
id Int @id | ||
} | ||
|
||
model delete { | ||
id Int @id | ||
} | ||
|
||
model AND { | ||
id Int @id | ||
} | ||
|
||
model User { | ||
id Int @id | ||
} | ||
|
||
model UserClient { | ||
id Int @id | ||
} | ||
|
||
model UserArgs { | ||
id Int @id | ||
} |
24 changes: 24 additions & 0 deletions
24
src/packages/client/src/__tests__/generation/dynamic-denylist.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
model User { | ||
id Int @id | ||
} | ||
|
||
model UserClient { | ||
id Int @id | ||
text String | ||
} | ||
|
||
model UserArgs { | ||
id Int @id | ||
} | ||
|
||
model Prisma { | ||
id Int @id | ||
} | ||
|
||
model Earth { | ||
id Int @id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters