sql-formatter icon indicating copy to clipboard operation
sql-formatter copied to clipboard

Add paramTypes config option

Open nene opened this issue 3 years ago • 1 comments

Added new config option paramTypes which allows overriding the prepared statement parameter types supported by default.

Did some slight restructuring of Tokenizer to allow config options to effect which kind of placeholder syntax is supported. This means that the parameter token regexes are no more cached, which however shouldn't be much of a performance concern as the really expensive part is building those large regexes form matching keywords. But will run some benchmarks to verify.

Fixes #367

nene avatar Aug 11 '22 09:08 nene

Ran some performance tests and as expected the differences were pretty much non-existant:

  • in Firefox the new version was a few percentages slower
  • in Chrome the new version was a few percentages faster

So, no measurable difference really.

nene avatar Aug 11 '22 14:08 nene