So, I’ve managed to include codemirror into my application and utilize sql-hint and the sql.js mode to make a pretty respectable query editor. Ability to suck in table / columns for auto completion is great.
I’d like to make sure I could support aliasing (which I realize may require codemirror to have a much better understanding of what is valid in sql ( select * from users u where u.).
Also, perhaps even select * from <automatically pops up table/views>
So I guess my question is, is there a way to provide a syntax tree of possible options and somehow generate a mode definition, or perhaps bypass mode all together and implement a different way to make a language available to syntax highlighting and auto completion?