-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract reusable parts of the client engine into a new pack…
…age (#26330) `@prisma/client-engine-runtime` being built by `@prisma/client`'s build script meant that we still needed to include the client package and all of its transitive dependencies into the workspace in `libs/driver-adapters` in the `prisma-engines` repo, which was causing some issues. This commit properly extracts the reusable parts of the client engine into a package for real. This is also important to make Accelerate work with the query compiler. Additionally, `@prisma/debug` is changed to be ESM compatible. This is because `@prisma/client-engine-runtime` needs to be ESM compatible and depends on `@prisma/debug`.
- Loading branch information
Showing
27 changed files
with
351 additions
and
251 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 |
---|---|---|
@@ -1 +1,4 @@ | ||
// this package is actually built by `@prisma/client` | ||
import { build } from '../../../helpers/compile/build' | ||
import { adapterConfig } from '../../../helpers/compile/configs' | ||
|
||
void build(adapterConfig) |
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,3 @@ | ||
module.exports = { | ||
preset: '../../helpers/test/presets/default.js', | ||
} |
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
File renamed without changes.
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,6 @@ | ||
export type QueryEvent = { | ||
timestamp: Date | ||
query: string | ||
params: unknown[] | ||
duration: number | ||
} |
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,10 @@ | ||
export type { QueryEvent } from './events' | ||
export { QueryInterpreter, type QueryInterpreterOptions } from './interpreter/QueryInterpreter' | ||
export * from './QueryPlan' | ||
export { | ||
IsolationLevel, | ||
type TransactionInfo, | ||
type Options as TransactionOptions, | ||
} from './transactionManager/Transaction' | ||
export { TransactionManager } from './transactionManager/TransactionManager' | ||
export { TransactionManagerError } from './transactionManager/TransactionManagerErrors' |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../runtime/engines/client/serialize.test.ts → ...runtime/src/interpreter/serialize.test.ts
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
2 changes: 1 addition & 1 deletion
2
.../engines/client/interpreter/serializer.ts → ...gine-runtime/src/interpreter/serialize.ts
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
17 changes: 17 additions & 0 deletions
17
packages/client-engine-runtime/src/transactionManager/Transaction.ts
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,17 @@ | ||
export const enum IsolationLevel { | ||
ReadUncommitted = 'ReadUncommitted', | ||
ReadCommitted = 'ReadCommitted', | ||
RepeatableRead = 'RepeatableRead', | ||
Snapshot = 'Snapshot', | ||
Serializable = 'Serializable', | ||
} | ||
|
||
export type Options = { | ||
maxWait?: number | ||
timeout?: number | ||
isolationLevel?: IsolationLevel | ||
} | ||
|
||
export type TransactionInfo = { | ||
id: string | ||
} |
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
Oops, something went wrong.