Repository navigation
Conversation
Serial columns without a primary key (cycle/database#106, 2.5.0) were undocumented, and the per-driver behaviour differs a lot: only PostgreSQL has a real non-PK counter, MySQL folds an AUTO_INCREMENT column into the primary key, SQLite and SQL Server have no option for it (#175). Assisted-By: Claude Opus 5.5
…mary key cycle/database#275 (cycle/database 2.23.4) keeps an autoIncrement column out of the primary key on MySQL, so the section now shows a counter with its own index instead of the composite-key workaround. Adding such a column to an existing table still fails with error 1075, so the docs keep it to new tables. Assisted-By: Claude Opus 5.5
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 was changed
Primary-key auto-increment was already covered; this documents auto-incremented columns that are not the primary key.
database/declaration.md: a new "Auto-increment Columns Outside the Primary Key" section with per-driver behaviour — PostgreSQLserial()/bigSerial()/smallSerial()(Adding the ability to use serial without primary key database#106, 2.5.0); MySQL, where since cycle/database 2.23.4 (fix(MySQL): keep auto-increment columns out of the primary key database#275) anautoIncrement: truecolumn stays out of the primary key and needs its own index, written intoCREATE TABLE; no support on SQLite and SQL Server.annotated/entity.md: entity examples for a PostgreSQLserialcolumn and a MySQLautoIncrementcolumn with a unique index, how the value is read back (RETURNINGon PostgreSQL; on MySQL the field staysnulluntil the entity is reloaded), and what happens on other drivers.Review notes
Checklist