Repository navigation
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fdd9d105c
ℹ️ 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".
| ( | ||
| alias | ||
| for alias in ("rowid", "_rowid_", "oid") | ||
| if alias not in declared |
There was a problem hiding this comment.
Preserve declared INTEGER PRIMARY KEY row-ID aliases
When a table declares rowid INTEGER PRIMARY KEY alongside _rowid_ TEXT and oid TEXT, rowid still aliases the actual integer row ID, but this helper treats all three names as shadowed and returns None. Starting with a single row whose ID is 42, transform(drop={'rowid'}, pk=None) consequently skips the hidden-ID copy and silently renumbers that row to 1; the parent commit preserved 42. Allow an integer-primary-key alias to supply source row IDs even when every magic alias is declared.
Useful? React with 👍 / 👎.
| None, | ||
| ) | ||
|
|
||
| source_rowid = rowid_alias(existing_columns) |
There was a problem hiding this comment.
Skip hidden row-ID copying for WITHOUT ROWID sources
For a populated CREATE TABLE nodes (rowid TEXT PRIMARY KEY, name TEXT) WITHOUT ROWID, transform(rename={'name': 'label'}) succeeded before this change but now raises IntegrityError: datatype mismatch. The helper selects _rowid_ merely because it is undeclared, although this source has no hidden row ID. With SQLite's default double-quoted-string behavior, the generated SELECT "_rowid_" produces a string literal that cannot be inserted into the destination's hidden integer ID. Check whether the source actually has a row ID before adding this copy expression.
Useful? React with 👍 / 👎.
Closes #999.
A table can have a text column called
rowidand still expose its integer row ID through_rowid_oroid. During a transform, the copy now picks an available alias from each schema independently. This preserves the hidden ID even when a rename changes which alias is available.The regression tests start with row ID 42 and two declared columns that shadow aliases. One renames an unrelated column. The other renames
RowIDtooid. Before the fix the first row was renumbered to 1 and the second transform raised a datatype mismatch. Both tests check the hidden ID and all three stored values.Windows, Python 3.14.7: 1,631 tests passed, 19 skipped.