Skip to content

Conversation

@geeksilva97
Copy link
Contributor

@geeksilva97 geeksilva97 commented Feb 10, 2025

Closes #56940

This PR adds the capability to the sqlite module to accept Buffer and URL as the database location.

@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. sqlite Issues and PRs related to the SQLite subsystem. labels Feb 10, 2025
@geeksilva97 geeksilva97 force-pushed the sqlite-accept-buffer branch 3 times, most recently from 2a608e1 to 5b5a8cf Compare February 20, 2025 01:37
@geeksilva97 geeksilva97 marked this pull request as ready for review February 20, 2025 01:38
@codecov
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 88.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 90.25%. Comparing base (c864dea) to head (7d1111f).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sqlite.cc 88.33% 2 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56991      +/-   ##
==========================================
- Coverage   90.33%   90.25%   -0.08%     
==========================================
  Files         630      630              
  Lines      184537   184681     +144     
  Branches    36077    36138      +61     
==========================================
- Hits       166693   166686       -7     
- Misses      10950    11021      +71     
- Partials     6894     6974      +80     
Files with missing lines Coverage Δ
src/node_sqlite.cc 78.79% <88.33%> (+0.21%) ⬆️

... and 29 files with indirect coverage changes

@geeksilva97 geeksilva97 force-pushed the sqlite-accept-buffer branch 4 times, most recently from 06d30bf to 4561203 Compare February 21, 2025 12:49
@geeksilva97 geeksilva97 changed the title [WIP] sqlite,test,doc: accept Buffer and URL as paths sqlite,test,doc: accept Buffer and URL as paths Feb 21, 2025
@cjihrig
Copy link
Contributor

cjihrig commented Feb 25, 2025

I think this needs a rebase to fix the CI issue.

cc: @nodejs/sqlite since this PR was opened before the team existed.

});
});

test('throws if the URL does not have the file: scheme', (t) => {
Copy link
Contributor

@louwers louwers Feb 25, 2025

Choose a reason for hiding this comment

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

You should also check the happy path.

Can you try URL("file://path/to/db.db?mode=ro") and verify that writes error out?

Passing a file:// or file: as URL as a string or Buffer should also be supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@cjihrig cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 27, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 27, 2025
@nodejs-github-bot
Copy link
Collaborator

@cjihrig cjihrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed needs-ci PRs that need a full CI run. labels Feb 27, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Feb 27, 2025
@nodejs-github-bot nodejs-github-bot merged commit c7cf677 into nodejs:main Feb 27, 2025
66 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in c7cf677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sqlite module consitent with other modules like fs

5 participants