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.

preferred package for debugging query text?

See original GitHub issue

Hi, I’m wondering if there is a preferred package, extension, or method for providing more detail when you get a syntax error back from the parser (for instance, one that listed line number, column of the error)

for instance, right now:

error: syntax error at or near "as"
    at Parser.parseErrorMessage (/home/collspec/projects/staff-portal/sprint-server/node_modules/pg-protocol/dist/parser.js:278:15)

desired behavior:

error: syntax error at or near "as", line 5, column 7
    at Parser.parseErrorMessage (/home/collspec/projects/staff-portal/sprint-server/node_modules/pg-protocol/dist/parser.js:278:15)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
CyberCookiecommented, Feb 17, 2022
error: syntax error at or near "`"
    at Parser.parseErrorMessage (/home/user/some_project/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/home/user/some_project/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/home/user/some_project/node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/home/user/some_project/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:293:12)
    at readableAddChunk (internal/streams/readable.js:267:9)
    at Socket.Readable.push (internal/streams/readable.js:206:10)
    at TCP.onStreamRead (internal/stream_base_commons.js:188:23) {
  length: 91,
  severity: 'ERROR',
  code: '42601',
  detail: undefined,
  hint: undefined,
  position: '157',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'scan.l',
  line: '1180',
  routine: 'scanner_yyerror'
}

Parsing errors returned from the PG package are almost useless since there is no info about file location where broken query is.

mysql2 package on the other hand do returns file location with broken query

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developing and Debugging PL/SQL using SQL Developer
Purpose. This tutorial shows you how to create, run, and debug a PL/SQL procedure using Oracle SQL Developer. Time to Complete. Approximately 30...
Read more >
Kentico Xperience Xplorations: Quickly Debugging Queries in ...
In this post we'll be exploring how to quickly and easily debug our Kentico Xperience 13 queries with a .NET 5 Console application...
Read more >
Coding and Debugging the Script Component - Microsoft Learn
To debug the code in your Script component, set at least one breakpoint in the code, and then close the VSTA IDE to...
Read more >
About Queries | Testing Library
For debugging using testing-playground, screen exposes this convenient method which logs and returns a URL that can be opened in a browser.
Read more >
Managing and debugging SQL queries in MS Access
For debugging, I edit them in a separate text editor that lets me format them sensibly. When I find I need to make...
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