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

fix(deps): update driver adapters directory (patch) #4829

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 13, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@effect/schema (source) 0.64.18 -> 0.64.20 age adoption passing confidence
@types/node (source) 20.12.3 -> 20.12.7 age adoption passing confidence
ts-pattern 5.1.0 -> 5.1.1 age adoption passing confidence
tsx 4.7.1 -> 4.7.2 age adoption passing confidence
typescript (source) 5.4.3 -> 5.4.5 age adoption passing confidence

Release Notes

Effect-TS/effect (@​effect/schema)

v0.64.20

Compare Source

Patch Changes
  • #​2483 42b3651 Thanks @​gcanti! - Add ParseIssueTitle annotation, closes #​2482

    When a decoding or encoding operation fails, it's useful to have additional details in the default error message returned by TreeFormatter to understand exactly which value caused the operation to fail. To achieve this, you can set an annotation that depends on the value undergoing the operation and can return an excerpt of it, making it easier to identify the problematic value. A common scenario is when the entity being validated has an id field. The ParseIssueTitle annotation facilitates this kind of analysis during error handling.

    The type of the annotation is:

    export type ParseIssueTitleAnnotation = (
      issue: ParseIssue,
    ) => string | undefined;

    If you set this annotation on a schema and the provided function returns a string, then that string is used as the title by TreeFormatter, unless a message annotation (which has the highest priority) has also been set. If the function returns undefined, then the default title used by TreeFormatter is determined with the following priorities:

    • identifier
    • title
    • description
    • ast.toString()

    Example

    import type { ParseIssue } from "@​effect/schema/ParseResult";
    import * as S from "@​effect/schema/Schema";
    
    const getOrderItemId = ({ actual }: ParseIssue) => {
      if (S.is(S.struct({ id: S.string }))(actual)) {
        return `OrderItem with id: ${actual.id}`;
      }
    };
    
    const OrderItem = S.struct({
      id: S.string,
      name: S.string,
      price: S.number,
    }).annotations({
      identifier: "OrderItem",
      parseIssueTitle: getOrderItemId,
    });
    
    const getOrderId = ({ actual }: ParseIssue) => {
      if (S.is(S.struct({ id: S.number }))(actual)) {
        return `Order with id: ${actual.id}`;
      }
    };
    
    const Order = S.struct({
      id: S.number,
      name: S.string,
      items: S.array(OrderItem),
    }).annotations({
      identifier: "Order",
      parseIssueTitle: getOrderId,
    });
    
    const decode = S.decodeUnknownSync(Order, { errors: "all" });
    
    // No id available, so the `identifier` annotation is used as the title
    decode({});
    /*
    throws
    Error: Order
    ├─ ["id"]
    │  └─ is missing
    ├─ ["name"]
    │  └─ is missing
    └─ ["items"]
       └─ is missing
    */
    
    // An id is available, so the `parseIssueTitle` annotation is used as the title
    decode({ id: 1 });
    /*
    throws
    Error: Order with id: 1
    ├─ ["name"]
    │  └─ is missing
    └─ ["items"]
       └─ is missing
    */
    
    decode({ id: 1, items: [{ id: "22b", price: "100" }] });
    /*
    throws
    Error: Order with id: 1
    ├─ ["name"]
    │  └─ is missing
    └─ ["items"]
       └─ ReadonlyArray<OrderItem>
          └─ [0]
             └─ OrderItem with id: 22b
                ├─ ["name"]
                │  └─ is missing
                └─ ["price"]
                   └─ Expected a number, actual "100"
    */

    In the examples above, we can see how the parseIssueTitle annotation helps provide meaningful error messages when decoding fails.

v0.64.19

Compare Source

Patch Changes
  • #​2471 58f66fe Thanks @​gcanti! - Class API: Added default title annotation to the encoded side.

    Before:

    import * as S from "@&#8203;effect/schema/Schema";
    
    class MySchema extends S.Class<MySchema>("MySchema")({
      a: S.string,
      b: S.number,
    }) {}
    
    S.decodeUnknownSync(MySchema)({}, { errors: "all" });
    /*
    Error: ({ a: string; b: number } <-> MySchema)
    └─ Encoded side transformation failure
       └─ { a: string; b: number }
          ├─ ["a"]
          │  └─ is missing
          └─ ["b"]
             └─ is missing
    */

    After:

    import * as S from "@&#8203;effect/schema/Schema";
    
    class MySchema extends S.Class<MySchema>("MySchema")({
      a: S.string,
      b: S.number,
    }) {}
    
    S.decodeUnknownSync(MySchema)({}, { errors: "all" });
    /*
    Error: (MySchema (Encoded side) <-> MySchema)
    └─ Encoded side transformation failure
       └─ MySchema (Encoded side)
          ├─ ["a"]
          │  └─ is missing
          └─ ["b"]
             └─ is missing
    */
  • #​2465 3cad21d Thanks @​gcanti! - length now allows expressing a range

    Example

    import * as S from "@&#8203;effect/schema/Schema";
    
    const schema = S.string.pipe(
      S.length({ min: 2, max: 4 }, { identifier: "MyRange" }),
    );
    
    S.decodeUnknownSync(schema)("");
    /*
    throws:
    Error: MyRange
    └─ Predicate refinement failure
       └─ Expected MyRange (a string at least 2 character(s) and at most 4 character(s) long), actual ""
    */
  • Updated dependencies [dadc690]:

    • effect@2.4.18
gvergnaud/ts-pattern (ts-pattern)

v5.1.1

Compare Source

What's Changed

Full Changelog: gvergnaud/ts-pattern@v5.1.0...v5.1.1

privatenumber/tsx (tsx)

v4.7.2

Compare Source

Microsoft/TypeScript (typescript)

v5.4.5: TypeScript 5.4.5

Compare Source

For release notes, check out the release announcement.

For the complete list of fixed issues, check out the

Downloads are available on:

v5.4.4: TypeScript 5.4.4

Compare Source

For release notes, check out the release announcement.

For the complete list of fixed issues, check out the

Downloads are available on:


Configuration

📅 Schedule: Branch creation - "every weekend" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from a team as a code owner April 13, 2024 03:19
@renovate renovate bot requested review from Druue and removed request for a team April 13, 2024 03:19
Copy link
Contributor

github-actions bot commented Apr 13, 2024

WASM Query Engine file Size

Engine This PR Base branch Diff
Postgres 2.130MiB 2.130MiB 0.000B
Postgres (gzip) 838.787KiB 838.788KiB -1.000B
Mysql 2.098MiB 2.098MiB 0.000B
Mysql (gzip) 825.532KiB 825.533KiB -1.000B
Sqlite 1.991MiB 1.991MiB 0.000B
Sqlite (gzip) 785.917KiB 785.917KiB 1.000B

Copy link

codspeed-hq bot commented Apr 13, 2024

CodSpeed Performance Report

Merging #4829 will not alter performance

Comparing renovate/patch-driver-adapters-directory (7c5dfa8) with main (e5f3dd7)

Summary

✅ 11 untouched benchmarks

Copy link
Contributor

github-actions bot commented Apr 13, 2024

✅ WASM query-engine performance won't change substantially (1.015x)

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
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
"
cpu: AMD EPYC 7763 64-Core Processor
runtime: node v18.20.2 (x64-linux)

benchmark                   time (avg)             (min … max)       p75       p99      p999
-------------------------------------------------------------- -----------------------------
• movies.findMany() (all - ~50K)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     370 ms/iter       (365 ms … 375 ms)    374 ms    375 ms    375 ms
Web Assembly: Latest       460 ms/iter       (457 ms … 465 ms)    464 ms    465 ms    465 ms
Web Assembly: Current      468 ms/iter       (465 ms … 475 ms)    475 ms    475 ms    475 ms
Node API: Current          203 ms/iter       (198 ms … 210 ms)    209 ms    210 ms    210 ms

summary for movies.findMany() (all - ~50K)
  Web Assembly: Current
   2.3x slower than Node API: Current
   1.27x slower than Web Assembly: Baseline
   1.02x slower than Web Assembly: Latest

• movies.findMany({ take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  14'966 µs/iter (14'745 µs … 17'718 µs) 14'911 µs 17'718 µs 17'718 µs
Web Assembly: Latest    18'712 µs/iter (18'320 µs … 20'672 µs) 18'770 µs 20'672 µs 20'672 µs
Web Assembly: Current   18'562 µs/iter (18'416 µs … 18'998 µs) 18'591 µs 18'998 µs 18'998 µs
Node API: Current        8'118 µs/iter   (7'783 µs … 8'527 µs)  8'232 µs  8'527 µs  8'527 µs

summary for movies.findMany({ take: 2000 })
  Web Assembly: Current
   2.29x slower than Node API: Current
   1.24x slower than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movies.findMany({ where: {...}, take: 2000 })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   2'318 µs/iter   (2'201 µs … 3'674 µs)  2'291 µs  3'341 µs  3'674 µs
Web Assembly: Latest     2'910 µs/iter   (2'787 µs … 3'902 µs)  2'872 µs  3'666 µs  3'902 µs
Web Assembly: Current    3'043 µs/iter   (2'816 µs … 5'586 µs)  2'907 µs  5'493 µs  5'586 µs
Node API: Current        1'413 µs/iter   (1'340 µs … 1'650 µs)  1'422 µs  1'623 µs  1'650 µs

summary for movies.findMany({ where: {...}, take: 2000 })
  Web Assembly: Current
   2.15x slower than Node API: Current
   1.31x slower than Web Assembly: Baseline
   1.05x slower than Web Assembly: Latest

• movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     566 ms/iter       (563 ms … 569 ms)    568 ms    569 ms    569 ms
Web Assembly: Latest       791 ms/iter       (782 ms … 806 ms)    803 ms    806 ms    806 ms
Web Assembly: Current      790 ms/iter       (786 ms … 793 ms)    791 ms    793 ms    793 ms
Node API: Current          469 ms/iter       (463 ms … 478 ms)    472 ms    478 ms    478 ms

summary for movies.findMany({ include: { cast: true } take: 2000 }) (m2m)
  Web Assembly: Current
   1.68x slower than Node API: Current
   1.4x slower than Web Assembly: Baseline
   1x faster than Web Assembly: Latest

• movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline  81'271 µs/iter (80'891 µs … 82'393 µs) 81'602 µs 82'393 µs 82'393 µs
Web Assembly: Latest       113 ms/iter       (112 ms … 116 ms)    115 ms    116 ms    116 ms
Web Assembly: Current      112 ms/iter       (112 ms … 113 ms)    113 ms    113 ms    113 ms
Node API: Current       62'560 µs/iter (61'953 µs … 63'957 µs) 63'086 µs 63'957 µs 63'957 µs

summary for movies.findMany({ where: {...}, include: { cast: true } take: 2000 }) (m2m)
  Web Assembly: Current
   1.79x slower than Node API: Current
   1.38x slower than Web Assembly: Baseline
   1.01x faster than Web Assembly: Latest

• movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'019 ms/iter   (1'008 ms … 1'028 ms)  1'025 ms  1'028 ms  1'028 ms
Web Assembly: Latest     1'307 ms/iter   (1'300 ms … 1'319 ms)  1'318 ms  1'319 ms  1'319 ms
Web Assembly: Current    1'317 ms/iter   (1'308 ms … 1'332 ms)  1'322 ms  1'332 ms  1'332 ms
Node API: Current          860 ms/iter       (842 ms … 874 ms)    873 ms    874 ms    874 ms

summary for movies.findMany({ take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.53x slower than Node API: Current
   1.29x slower than Web Assembly: Baseline
   1.01x slower than Web Assembly: Latest

• movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline     144 ms/iter       (143 ms … 146 ms)    145 ms    146 ms    146 ms
Web Assembly: Latest       184 ms/iter       (182 ms … 187 ms)    185 ms    187 ms    187 ms
Web Assembly: Current      186 ms/iter       (184 ms … 188 ms)    188 ms    188 ms    188 ms
Node API: Current          108 ms/iter       (104 ms … 110 ms)    109 ms    110 ms    110 ms

summary for movie.findMany({ where: { ... }, take: 2000, include: { cast: { include: { person: true } } } })
  Web Assembly: Current
   1.73x slower than Node API: Current
   1.29x slower than Web Assembly: Baseline
   1.01x slower than Web Assembly: Latest

• movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'039 µs/iter     (983 µs … 1'692 µs)  1'038 µs  1'530 µs  1'692 µs
Web Assembly: Latest     1'364 µs/iter   (1'299 µs … 2'282 µs)  1'360 µs  2'092 µs  2'282 µs
Web Assembly: Current    1'386 µs/iter   (1'321 µs … 2'489 µs)  1'384 µs  1'878 µs  2'489 µs
Node API: Current          830 µs/iter    (710 µs … 10'656 µs)    801 µs  1'248 µs 10'656 µs

summary for movie.findMany({ where: { reviews: { author: { ... } }, take: 100 }) (to-many -> to-one)
  Web Assembly: Current
   1.67x slower than Node API: Current
   1.33x slower than Web Assembly: Baseline
   1.02x slower than Web Assembly: Latest

• movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
-------------------------------------------------------------- -----------------------------
Web Assembly: Baseline   1'023 µs/iter     (986 µs … 1'637 µs)  1'029 µs  1'336 µs  1'637 µs
Web Assembly: Latest     1'360 µs/iter   (1'308 µs … 2'726 µs)  1'367 µs  1'759 µs  2'726 µs
Web Assembly: Current    1'432 µs/iter   (1'330 µs … 2'432 µs)  1'400 µs  2'194 µs  2'432 µs
Node API: Current          765 µs/iter     (707 µs … 1'054 µs)    783 µs    941 µs  1'054 µs

summary for movie.findMany({ where: { cast: { person: { ... } }, take: 100 }) (m2m -> to-one)
  Web Assembly: Current
   1.87x slower than Node API: Current
   1.4x slower than Web Assembly: Baseline
   1.05x slower than Web Assembly: Latest

After changes in 7c5dfa8

@renovate renovate bot force-pushed the renovate/patch-driver-adapters-directory branch 2 times, most recently from 9e132f4 to df5cae0 Compare April 20, 2024 01:20
@renovate renovate bot force-pushed the renovate/patch-driver-adapters-directory branch from df5cae0 to 7c5dfa8 Compare April 23, 2024 13:36
@janpio janpio added this to the 5.14.0 milestone Apr 23, 2024
@Jolg42 Jolg42 merged commit 461fac7 into main Apr 24, 2024
183 checks passed
@Jolg42 Jolg42 deleted the renovate/patch-driver-adapters-directory branch April 24, 2024 06:26
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.

2 participants