Skip to content

node:sqlite: StatementSync's setAllowUnknownNamedParameters(boolean) method isn't implemented #31196

@frou

Description

@frou

Version: Deno 2.5.6

With the help of that method, code like the following can work without throwing an error:

import { DatabaseSync } from "node:sqlite"

const person = {name: "Joe", age: 28, height: 185}

const db = new DatabaseSync(":memory:")
db.exec("CREATE TABLE attendees (name TEXT, age INTEGER)")

const stmt = db.prepare("SELECT COUNT(*) FROM attendees WHERE name = :name AND age = :age")
//stmt.setAllowUnknownNamedParameters(true)

stmt.get(person)

/*
Uncaught Error: Unknown named parameter 'height'
    at <anonymous>:11:6
    at eventLoopTick (ext:core/01_core.js:179:7)
*/

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions