js-sql-parser icon indicating copy to clipboard operation
js-sql-parser copied to clipboard

allow [$:] as prefix and plain ? for prepared statements

Open oger000 opened this issue 6 years ago • 1 comments

This allows handling of the $-prefix (postgresql and sequelize bind), :-previx (PHP PDO and sequelize replace) and single ? (most DBS for prepared steatement. But this PR allows this placeholder on more positions than the underlaying databases, so its for people who need preapared-statement support and know what they do. I am not shure if this should go into master. Anyway it works for me and is out for now. By the way some trailing whitespace are stripped, so use git diff -w

oger000 avatar Jul 26 '18 20:07 oger000

hi @oger000 , thanks for the pr and sorry for the late reply.

There are two things need to be discussed:

  • need support ? and ?? follows: https://github.com/mysqljs/mysql and https://github.com/go-sql-driver/mysql
  • i think placeholder should not be a Identifier in AST, or at least have a flag to label it out.

albin3 avatar Jul 31 '19 09:07 albin3