-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: clean up generation of logical prisma client (#1082)
- Loading branch information
Showing
37 changed files
with
961 additions
and
757 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
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
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
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 |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import type { DMMF } from '@prisma/generator-helper'; | ||
import type { PluginOptions } from '@zenstackhq/sdk'; | ||
import type { Model } from '@zenstackhq/sdk/ast'; | ||
import type { PluginFunction } from '@zenstackhq/sdk'; | ||
import { generate } from './generator'; | ||
|
||
export const name = 'SWR'; | ||
|
||
export default async function run(model: Model, options: PluginOptions, dmmf: DMMF.Document) { | ||
const run: PluginFunction = async (model, options, dmmf) => { | ||
if (!dmmf) { | ||
throw new Error('DMMF is required'); | ||
} | ||
return generate(model, options, dmmf); | ||
} | ||
}; | ||
|
||
export default run; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import type { DMMF } from '@prisma/generator-helper'; | ||
import type { PluginOptions } from '@zenstackhq/sdk'; | ||
import type { Model } from '@zenstackhq/sdk/ast'; | ||
import type { PluginFunction } from '@zenstackhq/sdk'; | ||
import { generate } from './generator'; | ||
|
||
export const name = 'Tanstack Query'; | ||
|
||
export default async function run(model: Model, options: PluginOptions, dmmf: DMMF.Document) { | ||
const run: PluginFunction = async (model, options, dmmf) => { | ||
if (!dmmf) { | ||
throw new Error('DMMF is required'); | ||
} | ||
return generate(model, options, dmmf); | ||
} | ||
}; | ||
|
||
export default run; |
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
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import type { DMMF } from '@prisma/generator-helper'; | ||
import { PluginOptions } from '@zenstackhq/sdk'; | ||
import { Model } from '@zenstackhq/sdk/ast'; | ||
import type { PluginFunction } from '@zenstackhq/sdk'; | ||
import { generate } from './generator'; | ||
|
||
export const name = 'tRPC'; | ||
export const dependencies = ['@core/zod']; | ||
|
||
export default async function run(model: Model, options: PluginOptions, dmmf: DMMF.Document) { | ||
const run: PluginFunction = async (model, options, dmmf) => { | ||
if (!dmmf) { | ||
throw new Error('DMMF is required'); | ||
} | ||
return generate(model, options, dmmf); | ||
} | ||
}; | ||
|
||
export default run; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type * from '.zenstack/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,2 @@ | ||
// @ts-expect-error stub for re-exporting PrismaClient | ||
export type * from '.zenstack/prisma'; |
Oops, something went wrong.