ygrek / sqlgg

SQL Guided (code) Generator
https://ygrek.org/p/sqlgg/
GNU General Public License v2.0
62 stars 20 forks source link

support for constants #94

Open cyberhuman opened 4 years ago

cyberhuman commented 4 years ago

It would be nice if something like this would be supported:

set foo = 1;
set bar = 2;
set baz = 3;

create table test ( f integer not null );

insert into test ( f ) values ( foo ), ( bar ), ( baz );

Syntax to be discussed.

ygrek commented 4 years ago

set is sql keyword. I understand you want these constants to be replaced by sqlgg at compile-time?

cyberhuman commented 4 years ago

set is sql keyword.

Yes I understand this. The above was just an example. It could be const foo = <value> or even an annotation -- @@const foo = <value> etc.

I understand you want these constants to be replaced by sqlgg at compile-time?

Yes, that's the idea. What do you think?