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

sqlite: make sourceSQL and expandedSQL string-valued properties #54721

Conversation

tniessen
Copy link
Member

@tniessen tniessen commented Sep 2, 2024

Change sourceSQL and expandedSQL from being methods to being string-valued properties. These fields

  • are conceptually properties (and not actions),
  • are derived deterministically from the current state of the object,
  • require no parameters, and
  • are inexpensive to compute.

Also, following the naming conventions of ECMAScript for new features, most function names should usually contain a verb, whereas names of (dynamically computed) properties generally should not, so the current names also seem more appropriate for properties than for functions.

@tniessen tniessen added the sqlite Issues and PRs related to the SQLite subsystem. label Sep 2, 2024
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Sep 2, 2024
Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.61%. Comparing base (65a4d26) to head (185c301).
Report is 658 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54721      +/-   ##
==========================================
+ Coverage   87.33%   87.61%   +0.28%     
==========================================
  Files         650      650              
  Lines      182829   182841      +12     
  Branches    35060    35381     +321     
==========================================
+ Hits       159677   160200     +523     
+ Misses      16417    15921     -496     
+ Partials     6735     6720      -15     
Files with missing lines Coverage Δ
src/node_sqlite.cc 84.39% <100.00%> (+0.39%) ⬆️
src/node_sqlite.h 0.00% <ø> (ø)

... and 59 files with indirect coverage changes

@benjamingr
Copy link
Member

cc @cjihrig

Change sourceSQL and expandedSQL from being methods to being
string-valued properties. These fields

- are conceptually properties (and not actions),
- are derived deterministically from the current state of the object,
- require no parameters, and
- are inexpensive to compute.

Also, following the naming conventions of ECMAScript for new features,
most function names should usually contain a verb, whereas names of
(dynamically computed) properties generally should not, so the current
names also seem more appropriate for properties than for functions.
@tniessen tniessen force-pushed the sqlite-sourcesql-expandedsql-properties branch from 97a8095 to 185c301 Compare September 4, 2024 19:35
@tniessen
Copy link
Member Author

tniessen commented Sep 4, 2024

Rebased on top of 6c6a933 (#54685).

@tniessen tniessen added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 4, 2024
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Sep 8, 2024

This PR is currently blocked from landing due to unreliable CI.

@tniessen tniessen added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 6, 2024
@tniessen
Copy link
Member Author

tniessen commented Oct 6, 2024

Let's retry :)

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 6, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@tniessen tniessen added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 6, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 6, 2024
@nodejs-github-bot nodejs-github-bot merged commit 7af434f into nodejs:main Oct 6, 2024
63 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 7af434f

aduh95 pushed a commit that referenced this pull request Oct 9, 2024
Change sourceSQL and expandedSQL from being methods to being
string-valued properties. These fields

- are conceptually properties (and not actions),
- are derived deterministically from the current state of the object,
- require no parameters, and
- are inexpensive to compute.

Also, following the naming conventions of ECMAScript for new features,
most function names should usually contain a verb, whereas names of
(dynamically computed) properties generally should not, so the current
names also seem more appropriate for properties than for functions.

PR-URL: #54721
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95 aduh95 mentioned this pull request Oct 9, 2024
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
Change sourceSQL and expandedSQL from being methods to being
string-valued properties. These fields

- are conceptually properties (and not actions),
- are derived deterministically from the current state of the object,
- require no parameters, and
- are inexpensive to compute.

Also, following the naming conventions of ECMAScript for new features,
most function names should usually contain a verb, whereas names of
(dynamically computed) properties generally should not, so the current
names also seem more appropriate for properties than for functions.

PR-URL: nodejs#54721
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@marco-ippolito marco-ippolito added the dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants