Skip to content

feat(sqlite): option to avoid pushing parameters to the stack #57932

Open
@aidant

Description

@aidant

What is the problem this feature will solve?

At the moment the only way to pass sqlite anonymous parameters is via the stack. This presents a problem as you can encounter a RangeError: Maximum call stack size exceeded when passing parameters.

Example
node --stack-size=50 # lowered to simulate the exception 
import { DatabaseSync } from 'node:sqlite'

const numbers = Array.from({ length: 1000 }, (_, index) => index)

console.log(
  JSON.parse( 
    new DatabaseSync(':memory:')
      .prepare(`select json_array(${numbers.map(() => '?')}) as numbers`)
      .get(...numbers).numbers
  )
)

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

Consider providing functionality for binding anonymous parameters to SQLite queries without having to place them on the stack.

What alternatives have you considered?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.sqliteIssues and PRs related to the SQLite subsystem.

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions