ygrek / sqlgg

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

insert null values #78

Closed cyberhuman closed 2 years ago

cyberhuman commented 5 years ago
create table test (
  id integer primary key auto_increment,
  column1 int not null,
  column2 int null,
  column3 int null default 0
)
-- insert
insert into test ( id, column1, column2, column3 )
  values ( @id, @column1, @column2, @column3 );
Sql.insert dbd ~id ~column1 ~column2 ~column3

column1 must accept int, but column2, column3, and id (because of auto_increment) must accept int option.

cyberhuman commented 5 years ago

Another point to make is that inserts that don't mention NOT NULL columns without a DEFAULT value must be rejected.

ygrek commented 4 years ago

ftr this is implemented, except for sanity checking wrt annotations on column definitions (NULL against DEFAULT)