Skip to content

dialect improuvments - #62

Merged
stbischof merged 5 commits into
eclipse-daanse:mainfrom
dbulahov:main210926
Sep 21, 2026
Merged

stbischof merged 5 commits into
eclipse-daanse:mainfrom
dbulahov:main210926

Conversation

@dbulahov

@dbulahov dbulahov commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

  1. Grant checks: write so test results publish
  2. COMMENT ON for tables and columns
  3. write only the foreign key actions Oracle supports
  4. rename indexes and constraints by their schema-scoped name
  5. name the primary key in CREATE TABLE
  6. Pagination with placeholders implementation

@dbulahov dbulahov changed the title Main210926 dialect improuvments Sep 21, 2026
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>
@stbischof
stbischof merged commit 0b2fcc6 into eclipse-daanse:main Sep 21, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants