Repository navigation
dialect improuvments - #62
Merged
Merged
Conversation
DdlGenerator gains commentOnTable(table, comment) and commentOnColumn(table, column, comment, currentMeta). The default is the SQL-standard COMMENT ON … IS '…' (a null comment removes it with IS NULL); both return Optional so a dialect can say it has no comments. Overrides: - MySQL/MariaDB: ALTER TABLE t COMMENT = '…'; a column comment can only be set by restating the column (MODIFY COLUMN c <type> [NOT NULL] [DEFAULT d] COMMENT '…'), hence the currentMeta parameter. - SQL Server: the MS_Description extended property — update when present, add otherwise, drop for null (schema defaults to dbo). - Oracle: IS '' instead of IS NULL. - ClickHouse: ALTER TABLE t MODIFY COMMENT / COMMENT COLUMN. - Hive: table comment via TBLPROPERTIES; no column comment. - Derby, SQLite: no comments (empty).
Oracle accepts ON DELETE CASCADE and ON DELETE SET NULL only. NO ACTION is the implicit behavior; RESTRICT and SET DEFAULT do not exist and fail with ORA-02000.
ALTER INDEX qualifies the index with the table's schema; SQL Server's sp_rename addresses a constraint as schema.constraint, not schema.table.constraint.
createTable dropped the primary key's constraint name, so every database picked its own and a later rename or drop by the modelled name missed. The key is now written as CONSTRAINT name PRIMARY KEY (…) when it has a name. ClickHouse and Hive/Impala have no named table constraints and keep the unnamed form (supportsNamedPrimaryKey).
Signed-off-by: <bulahovdenis@gmail.com>
dbulahov
force-pushed
the
main210926
branch
from
September 21, 2026 14:44
5cfb1fb to
3997cb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?