Skip to content

Commit

Permalink
chore: remove microsoftSqlServer flag
Browse files Browse the repository at this point in the history
Closes #4537
  • Loading branch information
Jolg42 committed Aug 26, 2021
1 parent 2877e3d commit 6020d68
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 26 deletions.
7 changes: 3 additions & 4 deletions packages/cli/src/Init.ts
Expand Up @@ -18,7 +18,8 @@ import { isError } from 'util'
import { printError } from './utils/prompt/utils/print'

export const defaultSchema = (provider: ConnectorType = 'postgresql') => {
if (provider === 'sqlserver' || provider === 'mongodb') {
// add preview flag
if (provider === 'mongodb') {
return `// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
Expand All @@ -29,9 +30,7 @@ datasource db {
generator client {
provider = "prisma-client-js"
previewFeatures = ["${
provider === 'sqlserver' ? 'microsoftSqlServer' : 'mongoDb'
}"]
previewFeatures = ["mongoDb"]
}
`
} else {
Expand Down
Expand Up @@ -4,8 +4,7 @@ datasource my_db {
}

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

model Post {
Expand Down
Expand Up @@ -5,20 +5,19 @@ datasource my_db {

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

// / User model comment
model User {
id String @default(uuid()) @id
id String @id @default(uuid())
email String @unique
// / name comment
name String?
posts Post[]
}

model Post {
id String @default(cuid()) @id
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
published Boolean
Expand Down
Expand Up @@ -5,7 +5,7 @@ datasource my_db {

generator client {
provider = "prisma-client-js"
previewFeatures = ["microsoftSqlServer", "referentialActions"]
previewFeatures = ["referentialActions"]
}

model Post {
Expand Down
4 changes: 4 additions & 0 deletions packages/engine-core/src/binary/BinaryEngine.ts
Expand Up @@ -171,6 +171,9 @@ export class BinaryEngine extends Engine {
this.connection = new Connection()

initHooks()

// See also warnOnDeprecatedFeatureFlag at
// https://github.com/prisma/prisma/blob/main/packages/sdk/src/engine-commands/getDmmf.ts#L179
const removedFlags = [
'middlewares',
'aggregateApi',
Expand All @@ -185,6 +188,7 @@ export class BinaryEngine extends Engine {
'nativeTypes',
'createMany',
'groupBy',
'microsoftSqlServer',
]
const removedFlagsUsed = this.previewFeatures.filter((e) =>
removedFlags.includes(e),
Expand Down
Expand Up @@ -149,10 +149,7 @@ type Settings = {
/**
* A list of available preview features on the Prisma client.
*/
type PreviewFeature =
| 'connectOrCreate'
| 'microsoftSqlServer'
| 'transactionApi'
type PreviewFeature = ''

/**
* Settings to add properties on the Prisma client.
Expand Down

This file was deleted.

@@ -1,6 +1,8 @@
import { introspectionIntegrationTest } from '../../__helpers__/integrationTest'
import {
introspectionIntegrationTest,
Input,
} from '../../__helpers__/integrationTest'
import { database } from './__database'
import { scenarios } from './__scenarios'
import { prismaClientSettings } from './__prismaClientSettings'

introspectionIntegrationTest({ scenarios, database, prismaClientSettings })
introspectionIntegrationTest({ scenarios, database })
@@ -1,6 +1,5 @@
import { runtimeIntegrationTest } from '../../__helpers__/integrationTest'
import { database } from './__database'
import { scenarios } from './__scenarios'
import { prismaClientSettings } from './__prismaClientSettings'

runtimeIntegrationTest({ database, scenarios, prismaClientSettings })
runtimeIntegrationTest({ database, scenarios })
Expand Up @@ -4,8 +4,7 @@ datasource db {
}

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

model User {
Expand Down
4 changes: 4 additions & 0 deletions packages/sdk/src/engine-commands/getDmmf.ts
Expand Up @@ -176,6 +176,9 @@ function addMissingOpenSSLInfo(message: string) {
}
return message
}

// See also removedFlags at
// https://github.com/prisma/prisma/blob/main/packages/engine-core/src/binary/BinaryEngine.ts#L174
function warnOnDeprecatedFeatureFlag(previewFeatures?: string[]) {
const getMessage = (flag: string) =>
`${chalk.blueBright(
Expand All @@ -193,6 +196,7 @@ function warnOnDeprecatedFeatureFlag(previewFeatures?: string[]) {
nativeTypes: getMessage('nativeTypes'),
createMany: getMessage('createMany'),
groupBy: getMessage('groupBy'),
microsoftSqlServer: getMessage('microsoftSqlServer'),
}

previewFeatures?.forEach((f) => {
Expand Down

0 comments on commit 6020d68

Please sign in to comment.