Support for custom SQL-extending grammar

I'd like to write a plugin for supporting SQL-extending grammar. I thought about implementing custom annotator but can't specify language SQL in plugin.xml. Started to implement custom language support, describes new keywords in bnf but do not want to describe SQL syntax. What do you advise?

0

What language do you work on?

0
Avatar
Permanently deleted user

We have a custom tool for applying and reverting migrations. SQL script surrounds with some meta information about migration. Also, there are a few new shortcuts for replacing SQL boilerplate. The tool that can parse and execute this scripts.

It may looks like:

AUTHOR ivan.ivanov;

BEGIN MIGRATION WITH AUTO UNDO

CREATE TABLE user (
id INTEGER NOT NULL PRIMARY KEY,
firstname TEXT NOT NULL
);
CREATE INDEX i_user_firstname ON user(firstname);

END MIGRATION
0
Avatar
Permanently deleted user

I follow the instructions to support syntax but do not know how to work with SQL inside migration. And is there any way to expand SQL syntax with new words.

0

I'd try to implement a separate template language instead

see com.intellij.psi.templateLanguages.TemplateLanguage API

 

0
Avatar
Permanently deleted user

Could you please provide any examples or links to documentation

0
Avatar
Permanently deleted user

Thanks a lot

0

请先登录再写评论。