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(client): Add omit option to the queries #23770

Merged
merged 1 commit into from
Apr 12, 2024
Merged

feat(client): Add omit option to the queries #23770

merged 1 commit into from
Apr 12, 2024

Conversation

SevInf
Copy link
Contributor

@SevInf SevInf commented Apr 8, 2024

Counterpart to prisma/prisma-engines#4807

Can be used standalone or combined with include, allows to exclude
the fields that normally would be included by default. Available in all
methods that return actual database records.

It is not useable together with select and attempt to do so would
cause type check and validation error.

When using together with result extensions, excluded dependency of a
computed field will be queried from a DB, but will not be returned to
the end user, unless computed field is exlucded as well (see "omit
with extensions" tests in this PR). This behaviour is equivalent to what
we do if depenency of a computed field is not mentioned in explicit
select.

TODO:

  • preview feature
  • validation of non-existing fields in exclude

Close prisma/team-orm#1080
#5042

/integration

@SevInf SevInf added this to the 5.13.0 milestone Apr 8, 2024
packages/client/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Apr 8, 2024

size-limit report 📦

Path Size
packages/client/runtime/library.js 179.34 KB (+1.03% 🔺)
packages/client/runtime/library.d.ts 81 B (0%)
packages/client/runtime/binary.js 600.59 KB (+0.31% 🔺)
packages/client/runtime/binary.d.ts 26 B (0%)
packages/client/runtime/edge.js 158.69 KB (+1.47% 🔺)
packages/client/runtime/edge-esm.js 158.59 KB (+1.47% 🔺)
packages/client/runtime/wasm.js 114.45 KB (+1.63% 🔺)
packages/client/runtime/index-browser.js 33.77 KB (0%)
packages/client/runtime/index-browser.d.ts 89 B (0%)
packages/cli/build/index.js 2.77 MB (0%)
packages/client/prisma-client-0.0.0.tgz 2.94 MB (+0.1% 🔺)
packages/cli/prisma-0.0.0.tgz 3.91 MB (+0.01% 🔺)
packages/bundle-size/da-workers-libsql/output.tgz 880.61 KB (+0.06% 🔺)
packages/bundle-size/da-workers-neon/output.tgz 957.83 KB (+0.05% 🔺)
packages/bundle-size/da-workers-pg/output.tgz 976.57 KB (+0.05% 🔺)
packages/bundle-size/da-workers-pg-worker/output.tgz 932.29 KB (+0.06% 🔺)
packages/bundle-size/da-workers-planetscale/output.tgz 895.46 KB (+0.05% 🔺)
packages/bundle-size/da-workers-d1/output.tgz 853.69 KB (+0.06% 🔺)

Copy link

codspeed-hq bot commented Apr 8, 2024

CodSpeed Performance Report

Merging #23770 will not alter performance

Comparing exclude (970156b) with main (67d5034)

Summary

✅ 3 untouched benchmarks

@SevInf SevInf force-pushed the exclude branch 2 times, most recently from c2efb08 to 0cd2f25 Compare April 9, 2024 16:54
@SevInf SevInf marked this pull request as ready for review April 9, 2024 16:55
@SevInf SevInf requested a review from a team as a code owner April 9, 2024 16:55
@SevInf SevInf requested review from jkomyno and removed request for a team April 9, 2024 16:55
@SevInf
Copy link
Contributor Author

SevInf commented Apr 10, 2024

Note: tests are failing because #23813 needs integration first, it should not block the review though.

Copy link
Contributor

@Druue Druue left a comment

Choose a reason for hiding this comment

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

🗒️ to be continued... 👀

@SevInf SevInf changed the title feat(client): Add exclude option to the queries feat(client): Add omit option to the queries Apr 11, 2024
@SevInf SevInf force-pushed the exclude branch 3 times, most recently from 910dc00 to 9a11913 Compare April 12, 2024 10:24
packages/client/package.json Outdated Show resolved Hide resolved
Copy link

socket-security bot commented Apr 12, 2024

No dependency changes detected. Learn more about Socket for GitHub ↗︎

👍 No dependency changes detected in pull request

Counterpart to prisma/prisma-engines#4807

Can be used standalone or combined with `include`, allows to exclude
the fields that normally would be included by default. Available in all
methods that return actual database records.

It is not useable together with `select` and attempt to do so would
cause type check and validation error.

When using together with result extensions, excluded dependency of a
computed field will be queried from a DB, but will not be returned to
the end user, unless computed field is exlucded as well (see "exclude
with extensions" tests in this PR). This behaviour is equivalent to what
we do if depenency of a computed field is not mentioned in explicit
`select`.

Close prisma/team-orm#1080
Copy link
Contributor

github-actions bot commented Apr 12, 2024

Client memory tests, node 18, library:

✅ Success

@SevInf SevInf merged commit 47e2430 into main Apr 12, 2024
206 of 207 checks passed
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.

None yet

2 participants