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

[pull] main from prisma:main #81

Open
wants to merge 143 commits into
base: main
Choose a base branch
from
Open

[pull] main from prisma:main #81

wants to merge 143 commits into from

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 13, 2024

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

renovate bot added 8 commits June 12, 2024 04:18
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
#24509)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…945 (#24501)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@pull pull bot added the ⤵️ pull label Jun 13, 2024
renovate bot and others added 21 commits June 13, 2024 09:58
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…24481)

* feat(client): added provider compatibility check for Driver Adapters

* chore(client): removed mock adapterName stub

* chore(client): adapted mock adapterName stub

* chore(client): remove console.logs

* test(client): fix failures in Node.js 16?

* test(client): get rid of libsql, which is not compatible with Node.js 16

* test(client): revert "breaking" change, due to panics happening in Rust. Added comments with TODo

* chore: fix tests?

* chore: fix tests??

* chore: fix tests, add D1

* chore: fix type tests

* chore: fix type tests?

* chore: fix type tests + module resolution issues with mock-adapter

* chore: fix e2e tests???

* chore: fix e2e tests??????

* test(client): split e2e "prisma-client-imports" in different test suite for each Driver Adapter provider

* chore: update pnpm-lock

* chore: removed unused undici import
…14.0 (#24542)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…9fc221e9de94 (#24560)

* test(client): SQLite "Timed out during query execution." for concurrent queries

Reproductions for #11789

* test(client); add more tests

* chore(deps): update engines to 5.16.0-1.fix-sqlite-concurrent-writes-74a48e9f33b0a8b403045af35430ce444541be88

* test(client): update tests for D1

* test(client): fix D1 test

* test(client): prove that #22947 is solved as well

* add DROP before create

* chore(client): rename test suite

* chore(client): fix mongodb issue?

* use `db.dropDb()`

* test(client): clean up functional tests, remove non-deterministic IDs

* test(client): run only on SQLite

* chore(deps): update engines to 5.16.0-16.4c3db41c3ad6086fa0f844bafe039fc221e9de94

* chore(client): fix UTF8 issues with Postgres

---------

Co-authored-by: Joël Galeran <[email protected]>
Co-authored-by: jkomyno <[email protected]>
Co-authored-by: Alberto Schiabel <[email protected]>
Should fix the failures for e2e tests.
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat: display the socket path during migration
* affects: PostgreSQL, CockroachDB, and MySQL
* feat(client): Implement global `omit` configuration

Allows to set `omit` option in `PrismaClient` constructor:

```ts
const prisma = new PrismaClient({
  omit: {
    user: {
      password: true
    }
  }
})
```

If developer does so, specified field will be omitted from all model
results by default as if local `omit` option was specified for every
query. It is still possible to include field explicitly either by using
`omit: { field: false }` or `select: { field: true }` on a query.

Also, just like in case of local omit, if result extension needs omitted
field, we will still query it from DB, but drop before returning the
final result.

Feature implemented under the same `omitApi` preview flag as local `omit`.

Implementation-wise, done by forwarding `ClientOptions` generic all the
way from `PrismaClient` to individual query results. Both local and
global `omit` are now applied at the moment of `DefaultSelection`
creation. Previously, local omit was applied after `select` and `include`,
but that does not work if we want to be able to undo global omit in
individual queries.

Close prisma/team-orm#1109
Ref #5042

* fix extensions tests

* Fix composites selection tests

* Address review feedback

* Render `omit` as required for empty selection
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
HRM and others added 30 commits September 4, 2024 11:56
Closes #24648
The fix changes GetPayloadResult utility type from a mapped type to a combination of an intersection and a mapped type. This way documentation doesn't get erased in the presence of an extension.

Tested cases:
1. no extension
2. extension without result extension
3. extension with result extension
4. result extension overwriting a field on base type
5. result extension with the omit feature
* Add the sqlite db to .gitignore

* Update the OTEL dependencies to be compatible with Prisma

* Update other `devDependencies` in `sandbox/tracing`

* Remove unused imports in `sandbox/tracing/index.ts`

* Fix deprecated imports

* Make it possible to merge PRs that only contain changes in aux files

* Ignore the actionlint error

* Try to avoid incorrect cli arg parsing

* Try to avoid incorrect args parsing v2

* See if we can bring back mapping
….0 (#25156)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* feat(driver-adapter-utils): add TransactionContext definitions and bindings

* feat(adapter-planetscale): add support for TransactionContext

* feat(adapter-pg): add support for TransactionContext

* feat(adapter-pg-worker): add support for TransactionContext

* feat(adapter-neon): add support for TransactionContext

* feat(adapter-libsql): add support for TransactionContext

* feat(adapter-d1): add support for TransactionContext

* chore(adapter-*): disable "@typescript-eslint/require-await"

* chore(adapter-*): avoid creating a new string when debug logs aren't enabled

* chore(deps): update engines to 5.20.0-7.190a98ffde8db4fe0b9ddeea2be06344bbc8edce

* test(client): fix mock-adapter in functional tests

* test(client): fix mock-adapter in e2e tests

---------

Co-authored-by: Alexey Orlenko <[email protected]>
Co-authored-by: Prismo <[email protected]>
* chore(e2e): Update next.js to 14 in "schema-not-found" suite

Updates next.js and adjusts few things for tests to work afterwards:

- `app` directory is no longer experimental and does not need config
  option.
- `standalone` server location can now be different depending on
  repository structure.
- code inside of server components was not idempotent. Calling `create` from
  a server component have always been wrong, but so far we've been lucky
  and that caused no issues. That changed after update. Replaced `delete`/`create` calls
  with `SELECT 1` query instead to avoid consistency issues in case
  component rendering gets aborted at restarted.

Additionally, this adjusts e2e setup to be able to talk to the databases
running on a host machine on macOS as well - previously, this worked
only on Linux.

Close prisma/team-orm#1280

* fix prettier
* added optimize to readme and updated pulse and accelerate links

* added studio and changed

* removed dataplatform from url
* feat(client): implement `strictUndefinedChecks`

If preview feature is enabled, client-side validator will disallow
explicitly setting fields to `undefined`. Newly introduced `Prisma.skip`
could be used for skipping fields explicitly.

This should protect against accidental empty filters on destructive
operations, for example:

```ts
prisma.table.deleteMany({
  where: {
    // If `nullableThing` is `null` or `undefined`, this query will remove
    // all data from the table
    property: nullableThing?.property,
  }
})
```

Intention is to make this behaviour default in Prisma 6.

[Full spec](#20169 (comment))

Close prisma/team-orm#1281
Close #20169
Close #20268

* Apply suggestions from code review

Co-authored-by: Alexey Orlenko <[email protected]>

---------

Co-authored-by: Alexey Orlenko <[email protected]>
…#25262)

For enum types, we are using DB names for types and values.
Problem: enum can be mapped to arbitrary name in the database that would
not necessary be a valid JS identifier. In that case, Prisma 5.19.0
generates syntactically invalid TS declaration.

This PR fixes this. Rather than introduce sanitization function (and
risk naming conflicts when sanitizer produces identical name for two
different originals), we are continuing to rely on DB names, we just use
them differently depending on their validity as an identifier.

For valid identifiers, we continue to use namespaced name:
`$DbEnum.MyEnum`.

For invalid ones, we access them as a string literal property:
`$DbEnums["MyEnum"]`.

Fix #25163
* tesT(e2e): Update types in e2e/default-version tests

Currently fails becuase the most recent typescript version fails on node
16 types.

* Update example too

* Update everything

* Update simple-ext

* Restore old types for ts-version tests

* Use node@18 types for ts latest
…d445d208c284 (#25266)

* chore(deps): update engines to 5.20.0-12.06fc58a368dc7be9fbbbe894adf8d445d208c284

* tests(client): fix tests after prisma/prisma-engines#5002

* tests(client): fix snapshots

* tests(client): fix snapshots

---------

Co-authored-by: jkomyno <[email protected]>
Co-authored-by: Alberto Schiabel <[email protected]>
`useLocalRuntime`, `transpile` and `useBuiltRuntime` options don't exist
anymore in the `generateInFolder` function this script calls. TypeScript
was complaining but we don't typecheck this file on CI. Since both
`--skip-transpile` and `--built-runtime` CLI flags didn't actually do
anything, I removed them.
…ad5a12272b72 (#25399)

* chore(deps): update engines to 5.21.0-32.6a192e231962f2731353b2df0d76ad5a12272b72

* test(client): update tracing tests for MongoDB to match real queries

Refs: prisma/prisma-engines#5014

---------

Co-authored-by: Alexey Orlenko <[email protected]>
#25453)

HMR can mess up `instanceof` checks so that older typed sql instances
won't be detected by newer, hot reloaded runtime.
Fixing this by adding "magic" property to the `TypedSQL` class and
checking for that instead, so it works across realms/different runtime
instances.

Fix #25331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.