Skip to content

Commit

Permalink
fix(*): engines version to 2.20.0-26 (#6313)
Browse files Browse the repository at this point in the history
Co-authored-by: William Luke <william@ordino.ai>
  • Loading branch information
Jolg42 and williamluke4 committed Mar 30, 2021
1 parent d240ce8 commit 062a7fa
Show file tree
Hide file tree
Showing 21 changed files with 18,766 additions and 10,966 deletions.
2 changes: 1 addition & 1 deletion src/packages/cli/package.json
Expand Up @@ -128,7 +128,7 @@
"precommit": "lint-staged"
},
"dependencies": {
"@prisma/engines": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c"
"@prisma/engines": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e"
},
"lint-staged": {
"*.ts": [
Expand Down
2 changes: 1 addition & 1 deletion src/packages/cli/src/__tests__/version.test.ts
Expand Up @@ -44,7 +44,7 @@ describe('version', () => {
const envVar = engineEnvVarMap[engine]
delete process[envVar]
}
}, 15000)
}, 20000)
})

function cleanSnapshot(str: string): string {
Expand Down
6 changes: 3 additions & 3 deletions src/packages/client/package.json
Expand Up @@ -59,11 +59,11 @@
"devDependencies": {
"@prisma/debug": "workspace:*",
"@prisma/engine-core": "workspace:*",
"@prisma/engines": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c",
"@prisma/engines": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e",
"@prisma/fetch-engine": "workspace:*",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "workspace:*",
"@prisma/migrate": "workspace:*",
"@prisma/fetch-engine": "workspace:*",
"@prisma/sdk": "workspace:*",
"@timsuchanek/copy": "1.4.5",
"@types/debug": "4.1.5",
Expand Down Expand Up @@ -127,7 +127,7 @@
}
},
"dependencies": {
"@prisma/engines-version": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c"
"@prisma/engines-version": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e"
},
"lint-staged": {
"*.ts": [
Expand Down
2 changes: 1 addition & 1 deletion src/packages/client/sandbox/dmmf.ts
Expand Up @@ -4,7 +4,7 @@ const datamodel = /* prisma */ `
generator client {
provider = "prisma-client-js"
previewFeatures = ["uncheckedScalarInputs", "createMany", "selectRelationCount"]
previewFeatures = ["uncheckedScalarInputs", "selectRelationCount"]
}
datasource db {
Expand Down
Expand Up @@ -5,7 +5,6 @@ datasource db {

generator client {
provider = "prisma-client-js"
previewFeatures = ["createMany"]
}

// / User model comment
Expand Down
Expand Up @@ -5,7 +5,6 @@ datasource db {

generator client {
provider = "prisma-client-js"
previewFeatures = ["createMany"]
}

// / User model comment
Expand Down
@@ -1,6 +1,6 @@
generator client {
provider = "prisma-client-js"
previewFeatures = ["groupBy", "createMany", "orderByRelation", "selectRelationCount"]
previewFeatures = ["orderByRelation", "selectRelationCount"]
}

datasource db {
Expand Down
Expand Up @@ -6,7 +6,6 @@ datasource db {
generator client {
provider = "prisma-client-js"
output = "@prisma/client"
previewFeatures = ["createMany"]
}

// / User model comment
Expand Down
Expand Up @@ -6,7 +6,6 @@ datasource db {
generator client {
provider = "prisma-client-js"
output = "@prisma/client"
previewFeatures = ["groupBy"]
}

// / User model comment
Expand Down
15 changes: 3 additions & 12 deletions src/packages/client/src/generation/TSClient/Count.ts
Expand Up @@ -101,8 +101,6 @@ class CountDelegate implements Generatable {
key !== 'groupBy' &&
value,
)
const previewFeatures = this.generator?.previewFeatures ?? []
const groupByEnabled = previewFeatures.includes('groupBy')
const groupByArgsName = getGroupByArgsName(name)
const countArgsName = getModelArgName(name, DMMF.ModelAction.count)
return `\
Expand Down Expand Up @@ -147,12 +145,7 @@ ${indent(getMethodJSDoc(DMMF.ModelAction.aggregate, mapping, model), TAB_SIZE)}
name,
)}>): PrismaPromise<${getAggregateGetName(name)}<T>>
${
groupByEnabled
? `${indent(
getMethodJSDoc(DMMF.ModelAction.groupBy, mapping, model),
TAB_SIZE,
)}
${indent(getMethodJSDoc(DMMF.ModelAction.groupBy, mapping, model), TAB_SIZE)}
groupBy<
T extends ${groupByArgsName},
HasSelectOrTake extends Or<
Expand Down Expand Up @@ -211,10 +204,8 @@ ${
: \`Error: Field "$\{P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
>(args: SubsetIntersection<T, ${groupByArgsName}, OrderByArg> & InputErrors): {} extends InputErrors ? ${getGroupByPayloadName(
name,
)}<T> : Promise<InputErrors>`
: ``
}
name,
)}<T> : Promise<InputErrors>
}
/**
Expand Down
21 changes: 4 additions & 17 deletions src/packages/client/src/generation/TSClient/Model.ts
Expand Up @@ -319,10 +319,6 @@ ${indent(
}

const hasRelationField = model.fields.some((f) => f.kind === 'object')
const groupByEnabled = (this.generator?.previewFeatures ?? []).includes(
'groupBy',
)

const includeType = hasRelationField
? `\nexport type ${getIncludeName(model.name)} = {
${indent(
Expand All @@ -348,7 +344,7 @@ ${indent(
${this.getAggregationTypes()}
${groupByEnabled ? this.getGroupByTypes() : ''}
${this.getGroupByTypes()}
export type ${getSelectName(model.name)} = {
${indent(
Expand Down Expand Up @@ -396,8 +392,6 @@ export class ModelDelegate implements Generatable {
key !== 'groupBy' &&
value,
)
const previewFeatures = this.generator?.previewFeatures ?? []
const groupByEnabled = previewFeatures.includes('groupBy')
const groupByArgsName = getGroupByArgsName(name)
const countArgsName = getModelArgName(name, DMMF.ModelAction.count)
return `\
Expand Down Expand Up @@ -442,12 +436,7 @@ ${indent(getMethodJSDoc(DMMF.ModelAction.aggregate, mapping, model), TAB_SIZE)}
name,
)}>): PrismaPromise<${getAggregateGetName(name)}<T>>
${
groupByEnabled
? `${indent(
getMethodJSDoc(DMMF.ModelAction.groupBy, mapping, model),
TAB_SIZE,
)}
${indent(getMethodJSDoc(DMMF.ModelAction.groupBy, mapping, model), TAB_SIZE)}
groupBy<
T extends ${groupByArgsName},
HasSelectOrTake extends Or<
Expand Down Expand Up @@ -506,10 +495,8 @@ ${
: \`Error: Field "$\{P}" in "orderBy" needs to be provided in "by"\`
}[OrderFields]
>(args: SubsetIntersection<T, ${groupByArgsName}, OrderByArg> & InputErrors): {} extends InputErrors ? ${getGroupByPayloadName(
name,
)}<T> : Promise<InputErrors>`
: ``
}
name,
)}<T> : Promise<InputErrors>
}
/**
Expand Down
9 changes: 0 additions & 9 deletions src/packages/client/src/runtime/getPrismaClient.ts
Expand Up @@ -1368,15 +1368,6 @@ new PrismaClient({
}

delegate.groupBy = (args) => {
if (!this._previewFeatures.includes('groupBy')) {
throw new Error(`To use "groupBy", please add "groupBy" to the previewFeatures attribute in the generator block:
generator client {
provider = "prisma-client-js"
previewFeatures = ["groupBy"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
`)
}
let unpacker: Unpacker | undefined = undefined

/**
Expand Down
2 changes: 1 addition & 1 deletion src/packages/engine-core/package.json
Expand Up @@ -41,7 +41,7 @@
},
"dependencies": {
"@prisma/debug": "workspace:*",
"@prisma/engines": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c",
"@prisma/engines": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "workspace:*",
"chalk": "^4.0.0",
Expand Down
2 changes: 0 additions & 2 deletions src/packages/engine-core/src/NAPIEngine.ts
Expand Up @@ -266,8 +266,6 @@ You may have to run ${chalk.greenBright(
featureFlagsOverrides: process.env.PRISMA_DEBUG_ENABLE_ALL_FLAGS
? [
'microsoftSqlServer',
'groupBy',
'createMany',
'orderByRelation',
'napi',
'mongoDb',
Expand Down
2 changes: 2 additions & 0 deletions src/packages/engine-core/src/NodeEngine.ts
Expand Up @@ -175,6 +175,8 @@ export class NodeEngine implements Engine {
'connectOrCreate',
'uncheckedScalarInputs',
'nativeTypes',
'createMany',
'groupBy',
]
const removedFlagsUsed = this.enableExperimental.filter((e) =>
removedFlags.includes(e),
Expand Down
2 changes: 1 addition & 1 deletion src/packages/fetch-engine/package.json
Expand Up @@ -14,7 +14,7 @@
],
"bugs": "https://github.com/prisma/prisma/issues",
"devDependencies": {
"@prisma/engines-version": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c",
"@prisma/engines-version": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e",
"@types/find-cache-dir": "3.2.0",
"@types/jest": "26.0.22",
"@types/node": "12.20.7",
Expand Down
2 changes: 1 addition & 1 deletion src/packages/migrate/package.json
Expand Up @@ -16,7 +16,7 @@
"version": "latest"
},
"devDependencies": {
"@prisma/engines-version": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c",
"@prisma/engines-version": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e",
"@prisma/generator-helper": "workspace:*",
"@prisma/sdk": "workspace:*",
"@types/diff": "4.0.2",
Expand Down
2 changes: 1 addition & 1 deletion src/packages/sdk/package.json
Expand Up @@ -48,7 +48,7 @@
"dependencies": {
"@prisma/debug": "workspace:*",
"@prisma/engine-core": "workspace:*",
"@prisma/engines": "2.21.0-1.89b1b736b1b049dad86bd2c65c2679cb469af72c",
"@prisma/engines": "2.20.0-26.60ba6551f29b17d7d6ce479e5733c70d9c00860e",
"@prisma/fetch-engine": "workspace:*",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "workspace:*",
Expand Down

0 comments on commit 062a7fa

Please sign in to comment.