Different results depending on highlighted text - SQL Editor

Hi all,

I’m trying create a SQL editor and replicate a function that many SQL tools have which is to allow users to key in many different queries at once. User can run all queries at once by clicking on the run button or by highlighting a specific command and then click run, only the result for that command will return.

This gif of Beekeeper Studio illustrates my points pretty well.

Thank you!

sql-editor.rp (54.0 KB)