Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Sqlite: Packages need a safe way to compose transactions without nested transaction errors

Open
#51 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
sqlite
Domain
database

Research direction

Start by reviewing the current transaction API in the unreleased Sqlite module and the linked SQLite transaction documentation. Determine how transaction state is represented and whether package functions can safely compose with caller-managed transactions. Done requires an agreed behavior and API for avoiding nested transaction errors, along with tests or documentation covering both wrapped and unwrapped calls.

Written by the indexing model from the issue text.

Description

enhancement

I'm writing some package code for the still unreleased Sqlite module, and am running into an issue with package design. I want to have some of the functions wrap multiple SQLite calls in a transaction. Which I can using the current API! However, the problem is SQLite will error if you run a transaction within another transaction. This is not ideal for writing code meant to be published and used by others.

I'm forced to choose between two not-so-great options:

  1. Use transactions and document that errors might happen if the caller wraps them in another transaction.
  2. Don't use transactions and, via documentation, highly encouraging users to wrap them in their own transaction.

Either option is not really a great experience for users.

Ideally, there would be some way for a given database to know it's in a transaction and just skip running the transaction SQL if it's already is. I'm not sure how this would be done, if it's even possible, or if it's at all a desirable bit of functionality. But I wanted to open the issue to point to the problem and see if anything could be done about it!

Dominant language
JavaScript
Stars
13
Forks
6
Avg merge
5d 20h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gren-lang/node

All issues in gren-lang/node

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.