Skip to content

fix(schema-engine): remove reference to removed --shadow-database-url flag from error message#5803

Merged
jacek-prisma merged 3 commits intoprisma:mainfrom
happinessee:fix/remove-shadow-database-url-flag-from-error-message
Apr 13, 2026
Merged

fix(schema-engine): remove reference to removed --shadow-database-url flag from error message#5803
jacek-prisma merged 3 commits intoprisma:mainfrom
happinessee:fix/remove-shadow-database-url-flag-from-error-message

Conversation

@happinessee
Copy link
Copy Markdown
Contributor

@happinessee happinessee commented Apr 10, 2026

Changes

Commit 1 — Update the error message in schema-engine/core/src/commands/diff_cli.rs to remove the reference to the --shadow-database-url CLI flag, which was removed from the TypeScript CLI in prisma/prisma#28432 (Prisma 7).

Before:

You must pass the `--shadow-database-url` flag or set `datasource.shadowDatabaseUrl`
in your `prisma.config.ts` if you want to diff a migrations directory.

After:

You must set `datasource.shadowDatabaseUrl` in your `prisma.config.ts`
if you want to diff a migrations directory.

Commit 2 — Following reviewer feedback, completely remove the deprecated shadow_database_url field from DiffParams on both sides:

  • Removed DiffParams.shadow_database_url (marked @deprecated in json-rpc-api)
  • Removed shadow_database_url parameter from json_rpc_diff_target_to_dialect() (had TODO: delete the parameter comment)
  • Removed dead-code block that re-constructed DatasourceUrls from the param
  • Removed outdated TODO comment about shadow_database_url
  • Updated all test fixtures that initialized the field (~32 sites across 5 files)

The DatasourceUrls.shadow_database_url field is intentionally preserved — it carries the value from datasource.shadowDatabaseUrl in prisma.config.ts, which is the new (and only) way to configure shadow DB for migrate diff.

JSON-RPC compatibility: DiffParams does not use #[serde(deny_unknown_fields)], so older CLI versions that still send the field will have it silently ignored by newer engines.

Context

The --shadow-database-url CLI flag was removed from prisma migrate diff in Prisma 7, but the Rust engine error message and the DiffParams field still referenced it. Users who followed the error message advice got an "unknown flag" error.

See prisma/prisma#29454 for the full bug report.

A companion PR for the TypeScript side is at prisma/prisma#29455 (removes the matching shadowDatabaseUrl field from MigrateDiffInput).

… flag from error message

The `--shadow-database-url` CLI flag was removed from the TypeScript
CLI in prisma/prisma#28432, but the Rust engine error message still
references it. Users who follow this advice get an "unknown flag" error.

Update the error message to only suggest the working option:
`datasource.shadowDatabaseUrl` in `prisma.config.ts`.

Fixes prisma/prisma#29454
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 10, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c75557aa-2a84-4902-beef-cd57768fa5aa

📥 Commits

Reviewing files that changed from the base of the PR and between 781e7db and 719ac9e.

📒 Files selected for processing (7)
  • schema-engine/core/src/commands/diff_cli.rs
  • schema-engine/json-rpc-api/src/types.rs
  • schema-engine/sql-migration-tests/tests/errors/error_tests.rs
  • schema-engine/sql-migration-tests/tests/migrations/diff.rs
  • schema-engine/sql-migration-tests/tests/migrations/drift_summary.rs
  • schema-engine/sql-migration-tests/tests/migrations/mysql.rs
  • schema-engine/sql-migration-tests/tests/single_migration_tests.rs
💤 Files with no reviewable changes (5)
  • schema-engine/sql-migration-tests/tests/migrations/mysql.rs
  • schema-engine/sql-migration-tests/tests/errors/error_tests.rs
  • schema-engine/sql-migration-tests/tests/single_migration_tests.rs
  • schema-engine/sql-migration-tests/tests/migrations/drift_summary.rs
  • schema-engine/json-rpc-api/src/types.rs

Summary by CodeRabbit

  • Breaking Changes

    • The --shadow-database-url CLI flag is no longer supported. Shadow databases must now be configured exclusively via shadowDatabaseUrl in your datasource configuration file.
  • Documentation

    • Updated error messages in migration and schema diff operations to direct users to configure shadow databases through datasource settings instead of CLI flags.

Walkthrough

Removed the shadow_database_url CLI/path parameter and its propagation: DiffParams no longer exposes shadow_database_url, migrations diff now relies on datasource config shadowDatabaseUrl, and tests and error messages were updated to reflect this change.

Changes

Cohort / File(s) Summary
CLI & migration logic
schema-engine/core/src/commands/diff_cli.rs
Stop propagating params.shadow_database_url into internal diff target resolution; removed internal cloning/override of DatasourceUrls and updated migrations-directory error message to omit --shadow-database-url.
JSON-RPC API types
schema-engine/json-rpc-api/src/types.rs
Removed the public shadow_database_url: Option<String> field from pub struct DiffParams (and its deprecation doc), so diff requests no longer accept a shadow DB URL.
Migration diff tests
schema-engine/sql-migration-tests/tests/migrations/diff.rs, schema-engine/sql-migration-tests/tests/migrations/drift_summary.rs, schema-engine/sql-migration-tests/tests/migrations/mysql.rs, schema-engine/sql-migration-tests/tests/single_migration_tests.rs
Removed explicit shadow_database_url assignments from multiple DiffParams in tests and adjusted expectations where error text referenced the removed CLI flag.
Error tests
schema-engine/sql-migration-tests/tests/errors/error_tests.rs
Removed explicit shadow_database_url: None from a DiffParams call; test now relies on implicit/default handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: removing the reference to the deprecated --shadow-database-url flag from an error message.
Description check ✅ Passed The description is detailed and directly related to the changeset, explaining both commits, the context, and the rationale for the changes.
Docstring Coverage ✅ Passed Docstring coverage is 88.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 10, 2026

Merging this PR will not alter performance

✅ 11 untouched benchmarks
⏩ 11 skipped benchmarks1


Comparing happinessee:fix/remove-shadow-database-url-flag-from-error-message (719ac9e) with main (7b80cc5)

Open in CodSpeed

Footnotes

  1. 11 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

…iffParams

The `shadow_database_url` field in `DiffParams` was marked as
`@deprecated` and had a `TODO: delete the parameter` comment on the
internal helper function. Since the `--shadow-database-url` CLI flag
was removed in Prisma 7, this field is dead code on the engine side.

Shadow database URL is now exclusively configured via
`datasource.shadowDatabaseUrl` in `prisma.config.ts`, which populates
the `DatasourceUrls` struct. The `DiffParams.shadow_database_url` field
is no longer populated by the CLI (always null).

This change:
- Removes `shadow_database_url` from `DiffParams` (json-rpc-api)
- Removes the `shadow_database_url` parameter from
  `json_rpc_diff_target_to_dialect()` and its dead-code block
- Removes the outdated TODO comment
- Updates all test fixtures that initialized the field

JSON-RPC compatibility: `DiffParams` does not use
`#[serde(deny_unknown_fields)]`, so older CLI versions sending the
field will have it silently ignored by newer engines.

Fixes prisma/prisma#29454
happinessee added a commit to happinessee/prisma that referenced this pull request Apr 10, 2026
…ffInput

Companion to prisma/prisma-engines#5803. The shadow database URL is
now exclusively configured via `datasource.shadowDatabaseUrl` in
`prisma.config.ts`, and the `DiffParams.shadow_database_url` field
has been removed from the schema engine.

This removes the matching `shadowDatabaseUrl` field from the
TypeScript `MigrateDiffInput` interface and the hardcoded `null`
value passed in `MigrateDiff.parse()`.

Fixes prisma#29454
@happinessee
Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion! I've pushed a follow-up commit that completely removes shadow_database_url from DiffParams on both sides:

  • This PR: Removed the DiffParams.shadow_database_url field (which was already marked @deprecated), removed the shadow_database_url parameter from json_rpc_diff_target_to_dialect() (which already had a TODO: delete the parameter comment), removed the associated dead-code block, and updated all test fixtures.
  • Companion PR: fix(migrate): remove dead --shadow-database-url reference in MigrateDiff prisma#29455 removes the matching shadowDatabaseUrl field from MigrateDiffInput in the TypeScript CLI.

The DatasourceUrls.shadow_database_url field is intentionally preserved since it represents the value from datasource.shadowDatabaseUrl in prisma.config.ts, which is the new (and only) way to configure the shadow DB for migrate diff.

JSON-RPC compatibility is maintained: DiffParams does not use #[serde(deny_unknown_fields)], so older CLI versions still sending the field will have it silently ignored by newer engines.

Ready for re-review 🙏

@jacek-prisma jacek-prisma merged commit 3187e39 into prisma:main Apr 13, 2026
98 of 99 checks passed
jacek-prisma pushed a commit to prisma/prisma that referenced this pull request Apr 14, 2026
…iff (#29455)

## Changes

**Commit 1** — Remove dead code referencing the removed
`--shadow-database-url` CLI flag in
`packages/migrate/src/commands/MigrateDiff.ts`.

**Before (line 286):**
```ts
shadowDatabaseUrl: args['--shadow-database-url'] ?? null,
```

**After (interim):**
```ts
shadowDatabaseUrl: null,
```

**Commit 2** — Following reviewer feedback, completely remove the
deprecated `shadowDatabaseUrl` field from `MigrateDiffInput`:

- Removed `shadowDatabaseUrl: string | null` from `MigrateDiffInput`
interface in `types.ts`
- Removed the `shadowDatabaseUrl: null` line from the
`migrate.engine.migrateDiff()` call

The matching `DiffParams.shadow_database_url` field has also been
removed from the schema engine in the companion PR:
prisma/prisma-engines#5803.

## Context

The `--shadow-database-url` flag was removed from the arg spec in #28432
(Prisma 7 breaking changes), but:
1. Line 286 still referenced `args['--shadow-database-url']` which
always evaluated to `undefined` → `null` via `??`
2. The `shadowDatabaseUrl` field in `MigrateDiffInput` was still passed
to the engine (as `null`)

Other removed flags (`--from-url`, `--to-url`, etc.) were properly
cleaned up in #28432, but `shadowDatabaseUrl` was missed in both the
function body and the type definition.

Shadow database URL is now exclusively configured via
`datasource.shadowDatabaseUrl` in `prisma.config.ts`. Tests using
`ctx.setDatasource({ url, shadowDatabaseUrl })` and `shadowdb.config.ts`
fixtures are unaffected — those represent the `datasource` configuration
path, which is the correct mechanism.

Fixes #29454
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants