feat: add auto-increment support to table editor.#10
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a5225f1f6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (col.isPrimaryKey && !inlinePk) | ||
| trailingPkColumns.push_back(col.name); |
There was a problem hiding this comment.
Reject mixed SQLite AUTOINCREMENT/composite primary keys
When a SQLite table has an auto-increment column plus any additional isPrimaryKey column, this logic still collects the extra PK columns for a trailing PRIMARY KEY (...) clause. createTable() then emits both an inline PRIMARY KEY AUTOINCREMENT and a second table-level primary key, which SQLite rejects, so table creation fails for that valid UI state.
Useful? React with 👍 / 👎.
| if (databaseType == DatabaseType::SQLITE && !col.isPrimaryKey) { | ||
| errorMessage = | ||
| "SQLite AUTOINCREMENT requires '" + col.name + "' to be a PRIMARY KEY"; | ||
| return false; |
There was a problem hiding this comment.
Enforce MySQL/MariaDB auto-increment key constraints
The new validation only enforces integer types and a SQLite-specific PK rule, but MySQL/MariaDB also require auto-increment columns to be keyed (and effectively limited to one per table). As written, users can mark non-key columns as auto-increment and pass validation, which leads to runtime DDL failures when executing the generated CREATE TABLE SQL.
Useful? React with 👍 / 👎.
No description provided.