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.

Does this support mysql query placeholders

See original GitHub issue

In python’s mysql client, parameter placeholders use %s

select * from users where id = %s

trying this out doesn’t seem to work in sqlglot. Using a ? works but that’s not the syntax. Is there a way to change the placeholder token?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
barakaloncommented, Aug 17, 2022

It feels pretty niche to me. Plus, there’re a plethora of Python MySQL clients, and this dialect would really be specific to one client.

So I’d say no, we shouldn’t add it, unless there’s a common enough use case. @togakangaroo - what are you trying to do? do either of the proposed solutions above work for you?

0reactions
barakaloncommented, Aug 17, 2022

yowza. Well, good luck 😂

Again, let me know if you have any more questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Prepared Statements and Placeholders in Queries
Using this approach, you write the statement using placeholders—special characters that indicate where the values go. One common placeholder character is ? ,...
Read more >
When to use ?? and ? as placeholders in node-mysql for ...
I am confused over when to use ?? and ? as placeholders in constructing a query. An example is here; var userId =...
Read more >
MySQL 8.0 Reference Manual :: 13.5 Prepared Statements
In prepared CALL statements used with PREPARE and EXECUTE , placeholder support for OUT and INOUT parameters is available beginning with MySQL 8.0....
Read more >
mysql-query-placeholders - npm
Start using mysql-query-placeholders in your project by running `npm i mysql-query-placeholders`. There are no other projects in the npm ...
Read more >
Using Prepared Statements and Placeholders in Queries
To use placeholders in DBI scripts, put a ? in your query string at each location where you want to insert a data...
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