Skip to content

PrismaMssql does not respect value escaping in connection string #28932

@brianthompson-arco

Description

@brianthompson-arco

Bug description

Before migrating to v7 and using the PrismaMssql adapter, my connection string worked with an escaped password. Since migrating the password failed as it was interpreting the {} as password characters.

My production database password has a semicolon in it, I could request that it be changed to one without ; or = as these are the characters I believe are causing the parsing error, but it was working before and the docs still recommend escaping (https://www.prisma.io/docs/orm/overview/databases/sql-server#connection-details).

Severity

⚠️ Major: Breaks core functionality (e.g., migrations fail)

Reproduction

Scenario 1

  • Attempt to configure a database connection with the Mssql driver adapter with an escaped password {password}
  • Observe that a password with no special characters fails to authenticate
  • Unescape the password and observe successful authentication

Scenario 2

Expected vs. Actual Behavior

Expected: Connection string with format sqlserver://domain:3342;database=database-name;user=prod-user;password={pass;word};encrypt=true;trustServerCertificate=true should work as it did in v6.

Actual: a password with no semicolon simply fails to authenticate. A password with a semicolon causes an error here https://github.com/prisma/prisma/blob/main/packages/adapter-mssql/src/connection-string.ts#L88

Frequency

Consistently reproducible

Does this occur in development or production?

Both development and production

Is this a regression?

Yes, worked in v6.

Workaround

Change password or use config object (would require I create env vars for the connection string for defineConfig and then duplicate them separated for PrismaClient).

Prisma Schema & Queries

Not relevant

Prisma Config

import { defineConfig } from 'prisma/config';

export default defineConfig({
  schema: 'prisma/schema.prisma',
  datasource: {
    url: process.env.DATABASE_URL!,
  },
});

Logs & Debug Info

// Debug logs here

Environment & Setup

  • OS: Linux
  • Database: Mssql
  • Node.js version: 24

Prisma Version

7.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/2-confirmedBug has been reproduced and confirmed.kind/bugA reported bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions