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

MySQL support (procedural language)

Open nene opened this issue 2 years ago • 2 comments

Procedural language

  • [x] DECLARE
  • [ ] SET
    • [x] basic syntax
    • [x] multi-variable assignment
    • [ ] GLOBAL, PERSIST, PERSIST_ONLY, SESSION
  • [x] BEGIN .. END block
  • [x] procedural CASE
  • [x] IF .. THEN .. ELSEIF .. ELSE .. END IF
  • [x] block labels
  • [x] LOOP .. END LOOP
  • [x] REPEAT .. UNTIL .. END REPEAT
  • [x] WHILE cond DO .. END WHILE
  • [x] LEAVE
  • [x] ITERATE
  • [x] RETURN
  • [x] CALL

nene avatar Jan 15 '24 18:01 nene

I hope this is the right place to add the DELIMITER command. It's old and standard: https://dev.mysql.com/doc/refman/5.7/en/stored-programs-defining.html

It's not supported in the parser.

I'd be happy to add it if I spoke PegJS, sorry.

TonyGravagno avatar Oct 25 '24 00:10 TonyGravagno

Better to create a separate issue for this as this DELIMITER is really quite a different beast. It's not really part of the language recognized by MySQL server, it's a command specific to the mysql client program (among several other commands, like use).

Created a separate issue here: #89

Frankly I'm not quite sure how to go about implementing this. There possibly needs to be some switch to toggle the parser into mysql client-mode.

nene avatar Oct 25 '24 08:10 nene