grammars-v4 icon indicating copy to clipboard operation
grammars-v4 copied to clipboard

Support empty column list in REFERENCES

Open 3manuek opened this issue 4 years ago • 2 comments
trafficstars

According to the MS SQL Server CREATE TABLE definition, REFERENCES should accept either specifying a column list or empty list at the column constraint lexer:

-- column_constraints
create table b (
  id int identity primary key,
  foreign_id int not null references a -- no column specified
);
GO

The grammar at line 3059 should be similar to table constraint as:

      | (FOREIGN KEY)? REFERENCES table_name ('(' pk = column_name_list')')? on_delete? on_update?

References

3manuek avatar Nov 13 '21 13:11 3manuek

Is this about TSql? Could you please suggest a pull request with an example?

KvanTTT avatar Nov 13 '21 14:11 KvanTTT

Is this about TSql? Could you please suggest a pull request with an example?

I'll need to get familiar with the project to provide a decent PR, although, there is a similar patch here.

3manuek avatar Nov 16 '21 19:11 3manuek