Skip to content

Message parsing optimization#495

Merged
tdrz merged 3 commits intomainfrom
tudor/parseOptimization
Jan 14, 2025
Merged

Message parsing optimization#495
tdrz merged 3 commits intomainfrom
tudor/parseOptimization

Conversation

@tdrz
Copy link
Collaborator

@tdrz tdrz commented Jan 14, 2025

This changes a bit the return of the parseResults() function in certain cases - see the updated basic test testEsmAndCjs.

@tdrz tdrz requested a review from samwillis January 14, 2025 15:59
@github-actions
Copy link
Contributor

Copy link
Collaborator

@samwillis samwillis left a comment

Choose a reason for hiding this comment

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

Nice, thanks! Looks like it solved something with affectedRows in the tests too?

We should add another changeset

From the root of the repo run pnpm changeset and follow the instructions. Everything is a patch change at the moment.

@tdrz
Copy link
Collaborator Author

tdrz commented Jan 14, 2025

Looks like it solved something with affectedRows in the tests too?

In some cases, like

      INSERT INTO test (name) VALUES ('test');
      UPDATE test SET name = 'test2';

affectedRows was not returned.

I hope that no other code was relying on the fact that it was not present.

Also, note this case:

// parse.ts
  if (resultSets.length === 0) {
    resultSets.push({
      rows: [],
      fields: [],
    })
  }

No affectedRows is returned. I have set it to affectedRows: 0

@tdrz tdrz merged commit c36fd09 into main Jan 14, 2025
6 of 7 checks passed
@tdrz tdrz deleted the tudor/parseOptimization branch January 14, 2025 20:34
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