Skip to content

[sqlite] Add inTransaction property #57922

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

Closed
zdm opened this issue Apr 18, 2025 · 1 comment · Fixed by #57925
Closed

[sqlite] Add inTransaction property #57922

zdm opened this issue Apr 18, 2025 · 1 comment · Fixed by #57925
Labels
feature request Issues that request new features to be added to Node.js. sqlite Issues and PRs related to the SQLite subsystem.

Comments

@zdm
Copy link

zdm commented Apr 18, 2025

What is the problem this feature will solve?

Some tine it is needed to get current transaction state.
better-sqlite3 provides inTransaction property for this. It is true is database handle is currently in the transaction state.
Could you please add something similar?

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

See above.

What alternatives have you considered?

See above.

@zdm zdm added the feature request Issues that request new features to be added to Node.js. label Apr 18, 2025
@github-project-automation github-project-automation bot moved this to Awaiting Triage in Node.js feature requests Apr 18, 2025
@cjihrig cjihrig added the sqlite Issues and PRs related to the SQLite subsystem. label Apr 18, 2025
@cjihrig
Copy link
Contributor

cjihrig commented Apr 18, 2025

Relevant SQLite API: https://sqlite.org/c3ref/get_autocommit.html

cjihrig added a commit to cjihrig/node that referenced this issue Apr 18, 2025
This commit adds an isTransaction getter to the DatabaseSync
class for determining if the database is currently within a
transaction.

Fixes: nodejs#57922
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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants