Skip to content

Add a method for retrieving the database location #57859

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

Open
geeksilva97 opened this issue Apr 13, 2025 · 2 comments · May be fixed by #57860
Open

Add a method for retrieving the database location #57859

geeksilva97 opened this issue Apr 13, 2025 · 2 comments · May be fixed by #57860
Assignees
Labels
feature request Issues that request new features to be added to Node.js. sqlite Issues and PRs related to the SQLite subsystem.

Comments

@geeksilva97
Copy link
Contributor

What is the problem this feature will solve?

This might be useful for cases where only the DatabaseSync object is received.

What is the feature you are proposing to solve the problem?

Add the method DatabaseSync.prototype.location as a wrapper to sqlite3_db_filename. It might receive the database name as an argument.

What alternatives have you considered?

N/A

@geeksilva97 geeksilva97 added feature request Issues that request new features to be added to Node.js. sqlite Issues and PRs related to the SQLite subsystem. labels Apr 13, 2025
@geeksilva97 geeksilva97 self-assigned this Apr 13, 2025
@github-project-automation github-project-automation bot moved this to Awaiting Triage in Node.js feature requests Apr 13, 2025
@geeksilva97 geeksilva97 linked a pull request Apr 13, 2025 that will close this issue
@geeksilva97 geeksilva97 moved this from Awaiting Triage to Triaged in Node.js feature requests Apr 13, 2025
@geeksilva97 geeksilva97 moved this from Triaged to In Progress in Node.js feature requests Apr 13, 2025
@tniessen
Copy link
Member

While simple enough, I am wondering if this is a pattern that we want to promote? I assume the intention is that applications can re-open the same database again? If so, then relying on this path alone may discard connection parameters since Node.js is setting SQLITE_OPEN_URI as far as I remember, and some VFS implementations may even allow moving database files around while they are open. If that is not the primary use case, I'd be curios what is.

@geeksilva97
Copy link
Contributor Author

I assume the intention is that applications can re-open the same database again?

That's correct.

Honestly, this is the case I used so far. These use cases you brought are interesting, and SQLite docs mention ways to handle them https://sqlite.org/c3ref/uri_boolean.html.

Maybe we can start with this very basic implementation and add more capabilities later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. sqlite Issues and PRs related to the SQLite subsystem.
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants