As per the discussion thread on play-framework-dev, this allows users to escape semicolons in their Evolutions by using double semicolons: ;;
Still waiting on some feedback before updating docs...
[#585, #1543, #212] Semicolon escape sequence ";;" in evolutions.
Thankyou for your contribution. Would you mind signing our CLA?
Just signed it!
[#585, #1543, #212] Adds to evolutions spec, removes from comments.
Not sure it matters, but I just realized that this implementation will have unexpected behavior with odd numbers of semicolons in a row. Expected behavior is probably that an odd number of consecutive semicolons would escape the first n - 1 semicolons, then delimit on the final one.
n - 1
Instead, the escaping as implemented will behave like ;; → ;, ;;; → ;;, ;;;; → ;;, ;;;;; → ;;;, etc.
;; → ;
;;; → ;;
;;;; → ;;
;;;;; → ;;;
Again, I'm not sure that it matters because I can't even imagine a scenario where you would want to escape a semicolon immediately before delimiting with one.
Yeah I considered iterating through the string, but it would have been a much bigger change and I wanted to stay conservative since this is my first Play2 PR =)
I'll f'sho update the docs...probably tomorrow sometime.
[#585, #1543, #212] Documents semicolon escape sequence in evolutions.
OK that's it for docs. In the interest of brevity I left out instructions for if you want to escape more than one consecutive semicolon. I think people can put together that it's just semicolons all the way down...
For example with plpgsql I have to use semicolons in a procedure declaration. It's annoying to escape it by entering one more. And I have to remove it to run the same script in pgAdmin or IntelliJ. Would it be better to use ordinary SQL comment as delimiter? It will work well in all SQL-dialects and tools as far as I know. Imagine -- #~# or smth like this.