Skip to content

Does not support postgres multi line comment with special characters #438

@sdoshibitgo

Description

@sdoshibitgo

Describe the bug

Trying this with typeorm

const cmment = JSON.stringify({"requestId":"test-request-id"}) await PGLiteDataSource.query(CREATE TABLE IF NOT EXISTS todo (
id SERIAL PRIMARY KEY,
task TEXT,
done BOOLEAN DEFAULT false
) /* RequestId ${cmment} RequestId */);

QueryFailedError: invalid syntax at line 5 col 28:

3          task TEXT,
4          done BOOLEAN DEFAULT false
5              ) /* RequestId {"requestId":"test-request-id"} RequestId */;
                              ^
Unexpected input (lexer error). Instead, I was expecting to see one of the following:

    - A "kw_primary" token
    - A "kw_unique" token
    - A "quoted_word" token
    - A "word" token
    - A "semicolon" token

To Reproduce

"If possible, paste here (including create table statements) a query that fails on https://oguimbal.github.io/pg-mem-playground/, but suceeds when ran on an actual PG database"

pg-mem version

(paste your pg-mem version here)

(nb: the version in your package.json version is often not precise enough... please run "cat ./node_modules/pg-mem/package.json | grep version" to tell which minor version is actually installed)

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