- Only differentiates between column creation and column alteration, but there are two ways to create a column and some databases (I'm looking at you, DB2) have a different syntax for both.
- Difficult to change the order (some anonymous lambda array)
- Column definition in
CREATE TABLE
- Column definition in
ALTER TABLE ... ADD COLUMN
- Column definition in
ALTER TABLE ... ALTER COLUMN
PRIMARY KEY
constraintFOREIGN KEY
constraint- Other constraints (optional)
Just some random ideas:
- Using SQL fragments
- SQL fragments wrapped in classes
- Pattern matching
- Maybe different API for all three use cases?
- How to handle the seconday use cases?