Skip to content

Commit

Permalink
feat(client): Add useUds to __internal parameter interface and pass t…
Browse files Browse the repository at this point in the history
…he parameter to the NodeEngine class (#4615)

Co-authored-by: Шабалкин Леонид Викторович <l.shabalkin@tinkoff.ru>
  • Loading branch information
leoShabalkin and Шабалкин Леонид Викторович committed Dec 15, 2020
1 parent 0a2d9a2 commit 2a5922c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/packages/client/src/runtime/getPrismaClient.ts
Expand Up @@ -87,6 +87,7 @@ export interface PrismaClientOptions {
__internal?: {
debug?: boolean
hooks?: Hooks
useUds?: boolean
engine?: {
cwd?: string
binaryPath?: string
Expand Down Expand Up @@ -371,6 +372,7 @@ export function getPrismaClient(config: GetPrismaClientOptions): any {
flags: [],
clientVersion: config.clientVersion,
enableExperimental: mapPreviewFeatures(this._previewFeatures),
useUds: internal.useUds
}

debug({ clientVersion: config.clientVersion })
Expand Down
4 changes: 3 additions & 1 deletion src/packages/engine-core/src/NodeEngine.ts
Expand Up @@ -51,6 +51,7 @@ export interface EngineConfig {
logLevel?: 'info' | 'warn'
env?: Record<string, string>
flags?: string[]
useUds?: boolean;

clientVersion?: string
enableExperimental?: string[]
Expand Down Expand Up @@ -169,9 +170,10 @@ export class NodeEngine {
enableDebugLogs,
enableEngineDebugMode,
dirname,
useUds,
}: EngineConfig) {
this.dirname = dirname
this.useUds = process.platform !== 'win32'
this.useUds = useUds === undefined ? process.platform !== 'win32' : useUds;
this.env = env
this.cwd = this.resolveCwd(cwd)
this.enableDebugLogs = enableDebugLogs ?? false
Expand Down

0 comments on commit 2a5922c

Please sign in to comment.