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.

Is it possible to get the SQL query?

See original GitHub issue

I’m getting some SQL syntax errors right now using the prepared statements, and it would be helpful for debugging to be able to see the SQL query that gets executed. In the original mysql package i could do that as q=connection.query();console.log(q.sql) but here q is a Promise. Perhaps even just if it throws an error, include that as a property on the error object.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Arnoldnuocommented, Oct 23, 2016

Does it have any progress?

2reactions
linusnortoncommented, Sep 21, 2016

I’m not sure if this is helpful but you can set debug: ['ComQueryPacket', 'RowDataPacket'] when you create the connection to debug all queries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL SELECT Statement - W3Schools
The SQL SELECT Statement. The SELECT statement is used to select data from a database. The data returned is stored in a result...
Read more >
SQL example statements for retrieving data from a table - IU KB
An SQL SELECT statement retrieves records from a database table according to clauses (for example, FROM and WHERE ) that specify criteria.
Read more >
How to Create a SQL Statement - UCSD Blink
1. Start your query with the select statement. · 2. Add field names you want to display. · 3. Add your statement clause(s)...
Read more >
How do I view the SQL generated by the Entity Framework?
If you're interested in seeing the SQL just while development, you can use LINQPad. When you run a LINQ query in the results...
Read more >
An Introductory SQL Tutorial: How to Write Simple Queries
Learn how to get started with this beginner's guide to writing simple SQL queries. ... Begin writing a SQL query to pull your...
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