Use RETURNING clause and IDENTITY GENERATED ALWAYS for Ids
ehuelsmann opened this issue · comments
Erik Huelsmann commented
Issue Template
Description
PostgreSQL, Oracle, MySQL/MariaDB and SQLite all support RETURNING, which saves a "post-fetch".
All except SQLite support GENERATED ALWAYS AS IDENTITY. SQLite supports autoincrement. All of these allow RETURNING to indicate the ID primary key of the newly inserted row. All of the above also have functions to generate UUID columns.
Using the database to assign the row value instead of supplying one simplifies the code to insert a new workflow it history item.