-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework sequence-based identity generation #8850
Comments
@beberlei I think this should go in a "DBAL 4" support project, shouldn't it? 😄 |
In fact, this functionality in the ORM could be salvaged, if necessary. I updated the subject and the description. The DBAL doesn't support using sequence values to implement $id = $conn->execute('SELECT ' . $seqName . '.NEXTVAL FROM DUAL');
$conn->insert($table, ['id' => $id]); In this case, the ORM should not declare the column as It is also possible to leave the sequence ownership to the DBAL and have the column always auto-incremented via a trigger. In this case, the ORM should use a query like: INSERT INTO table VALUES (...) RETURNING id INTO :id; And then use an out parameter to get the id. |
This is about using a SequenceGenerator instead of a IdentityGenerator then (as that's what the SequenceGenerator does) |
I suggest instead deprecating the support for sequence-based IdentityGenerator, so that projects using a platform that does not support identity columns have to use something else (for instance the SequenceGenerator) |
Hello, today I changed the id columns' strategy from IDENTITY to SEQUENCE in my entities after reading the deprecation messages, and now all the insert statements have
|
Sequence-based identity values will be deprecated in DBAL
3.2.0
(doctrine/dbal#4688) and removed in4.0.x
(doctrine/dbal#4691). See the details in doctrine/dbal#4687.The ORM currently uses this API:
orm/lib/Doctrine/ORM/Id/IdentityGenerator.php
Lines 52 to 55 in f3e55fa
Please consider not relying on this API.
The text was updated successfully, but these errors were encountered: