Skip to content

SqliteClient > Statement escape #44

@michaelpeterlee

Description

@michaelpeterlee

String parsing appears to be happening somewhere, breaking this longstanding cross-platform SQLite statement, below.

image

This statement escapes by presenting double-quotes twice.

const sqlite = new SqliteClient(FILENAME, WORKER_PATH);
await sqlite.init();

sqlite.executeSql(
        'CREATE TABLE IF NOT EXISTS queue' +
        '(' +
            'id INTEGER PRIMARY KEY AUTOINCREMENT, ' +
            'object VARCHAR(5000), ' +
        ')'
);

const sql = 'UPDATE queue SET object = REPLACE(REPLACE(object,"processing","queued"),"attempt"":5","attempt"":0")';
sqlite.executeSql(sql);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions