Skip to content

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Oct 14, 2025

This PR:

  • adds a new get_generators utility to @prisma/prisma-schema-wasm. It's basically a subset of get_config that doesn't fail when the datasource block is considered invalid

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 13:01
@jkomyno jkomyno added this to the 6.18.0 milestone Oct 14, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new get_generators utility to @prisma/prisma-schema-wasm that can retrieve generator blocks from a Prisma schema even when the datasource block is invalid or malformed.

  • Adds a new parse_generators function that only parses generator blocks without validating the entire schema
  • Introduces a new get_generators function to the WASM interface that wraps this functionality
  • Adds deprecation warnings for datasource attributes that will be moved to Prisma Config file in version 7.0.0

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
psl/psl/src/lib.rs Exports the new parse_generators function
psl/psl-core/src/lib.rs Implements the core parse_generators function
psl/psl-core/src/validate/datasource_loader.rs Adds deprecation warnings for datasource attributes
psl/diagnostics/src/warning.rs Adds warning message for datasource attributes moved to Prisma config
prisma-schema-wasm/src/lib.rs Exposes get_generators function in WASM interface
prisma-fmt/src/lib.rs Adds the new get_generators command with documentation
prisma-fmt/src/get_generators.rs Implements the complete get_generators functionality with comprehensive tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

codspeed-hq bot commented Oct 14, 2025

CodSpeed Performance Report

Merging #5649 will not alter performance

Comparing feat/psl-config-aware (af43c7f) with main (34b5a69)

Summary

✅ 11 untouched

Copy link
Contributor

github-actions bot commented Oct 14, 2025

WASM Query Engine File Size

Engine This PR Base branch Diff
Postgres 2.191MiB 2.191MiB 405.000B
Postgres (gzip) 868.095KiB 867.875KiB 226.000B
Mysql 2.159MiB 2.159MiB 406.000B
Mysql (gzip) 854.627KiB 854.556KiB 73.000B
Sqlite 2.072MiB 2.071MiB 397.000B
Sqlite (gzip) 820.417KiB 820.065KiB 361.000B
SQL Server 2.130MiB 2.130MiB 397.000B
SQL Server (gzip) 845.656KiB 845.554KiB 104.000B
CockroachDB 2.214MiB 2.213MiB 405.000B
CockroachDB (gzip) 877.119KiB 876.985KiB 137.000B

WASM Query Compiler File Size

Engine This PR Base branch Diff
Postgres 1.859MiB 1.859MiB 394.000B
Postgres (gzip) 733.893KiB 733.865KiB 29.000B
Mysql 1.826MiB 1.825MiB 402.000B
Mysql (gzip) 722.142KiB 722.241KiB -101.000B
Sqlite 1.783MiB 1.783MiB 394.000B
Sqlite (gzip) 704.629KiB 704.393KiB 242.000B
SQL Server 1.856MiB 1.856MiB 402.000B
SQL Server (gzip) 735.353KiB 735.138KiB 220.000B
CockroachDB 1.884MiB 1.884MiB 394.000B
CockroachDB (gzip) 743.537KiB 743.461KiB 77.000B

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.

1 participant