Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schema-engine): don't query CHECK_CONSTRAINTS on MySQL <= 8.0.16 #4661

Merged

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Jan 22, 2024

@jkomyno jkomyno added this to the 5.9.0 milestone Jan 22, 2024
@jkomyno jkomyno self-assigned this Jan 22, 2024
Comment on lines +63 to +66
// MySQL 5.6 and 5.7 do not have a CHECK_CONSTRAINTS table we can query.
// MariaDB, although it supports check constraints, adds them unexpectedly.
// E.g., MariaDB 10 adds the `json_valid(\`Priv\`)` check constraint on every JSON column;
// this creates a noisy, unexpected diff when comparing the introspected schema with the prisma schema.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These comments are taken from schema-engine/sql-schema-describer/src/mysql.rs.

Copy link
Contributor

github-actions bot commented Jan 22, 2024

WASM Size

Engine This PR Base branch Diff
WASM 2.338MiB 2.338MiB 0.000B
WASM (gzip) 907.885KiB 907.885KiB 0.000B

Copy link

codspeed-hq bot commented Jan 22, 2024

CodSpeed Performance Report

Merging #4661 will not alter performance

Comparing fix/dont-query-check-constraints-on-mysql-8.0.15-and-below (f171d68) with main (c71605d)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

✅ WASM query-engine: no benchmarks have regressed

Full benchmark report
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/bench?schema=imdb_bench&sslmode=disable" \
node --experimental-wasm-modules query-engine/driver-adapters/executor/dist/bench.mjs

After changes in f171d68

@jkomyno jkomyno marked this pull request as ready for review January 22, 2024 12:34
@jkomyno jkomyno requested a review from a team as a code owner January 22, 2024 12:34
@jkomyno jkomyno requested review from laplab, Weakky, Jolg42 and SevInf and removed request for a team, laplab, Weakky and Jolg42 January 22, 2024 12:34
Copy link
Contributor

@Jolg42 Jolg42 left a comment

Choose a reason for hiding this comment

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

Looks good to me, though would be better with a test I think (we discussed that adding a test would require an old version of the MySQL image)

@jkomyno jkomyno merged commit 23fdc59 into main Jan 29, 2024
139 checks passed
@jkomyno jkomyno deleted the fix/dont-query-check-constraints-on-mysql-8.0.15-and-below branch January 29, 2024 15:10
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.

Prisma errors fetching table 'CHECK_CONSTRAINTS' (which only exists in MySQL 8.0.16+) in MySQL 8.0.14
2 participants