question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pg` adapter leaks symbols in rows

See original GitHub issue

Hello again, We noticed that rows being return from pg adapter queries include Symbol(_id). This is mostly aesthetic, but can be confusing. I’ll be happy try a PR, do you have any pointers ? Best,

// pg-mem/src/tests/pg.spec.ts

it('does not leak symbol properties in rows', async () => {
    simpleDb();
    const { Client } = db.adapters.createPg();
    const client = new Client();
    await client.connect();

    many(`create table mytable (msg varchar);
        insert into mytable values ('hello'), ('hi');`);

    const got = await client.query('select * from mytable;');

    // fails
    expect(Object.getOwnPropertySymbols(got.rows[0]).length).to.be.equal(0);

    await client.end();
});

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
oguimbalcommented, Jul 26, 2021

@A7med-Ragheb this shipped with pg-mem@1.9.12

1reaction
oguimbalcommented, Jul 12, 2021

I guess that you could clone the results using somehting like Object.fromEntries(Object.entries(myRow)) in adaptResults() to get rid of the symbols

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common symbols around you - Helpful
The third line (output)'s solid and dotted line indicates DC. Power supply type: switch-mode, linear, general/unspecified.
Read more >
undici leaking Symbol to global space in 18.2 (but not 18.1)
Aren't we supposed to detect leaked globals in the Node.js CI? The check is in test/common/index.js . I'm guessing that it would miss...
Read more >
Database.txIf - pg-promise API
A promise object that represents the query result: When no rows are returned, it resolves with an empty array. When 1 or more...
Read more >
Capacitors - SparkFun Learn
The capacitors symbol consists of two parallel lines, which are either flat or curved; both lines should be parallel to each other, close,...
Read more >
iOS 9 iPad keyboard adds keys & symbols at bigger screen ...
These symbols appear larger in the first full-size keycap row, again along with some new additions compared to current iPads. The larger layout ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found