Open chrisparton1991 opened 4 years ago
Seems reasonable yes
Would you like to put together a PR?
Sure, I'll have a crack at it when I've got some spare time.
I forgot about this issue as it became less of a problem when I moved away from generated integer primary keys.
However, issue #993 doesn't resolve this as it's only for MySql, not SQL Server.
Would it be a case of making the same updates to Dialect
and AbstractSqlRepositoryOperations.isSupportsBatchInsert
for SQL Server? i.e. allow batch inserts when not using a generated ID?
This issue doesn't fall into the issue template sorry, so I'll keep it short.
Micronaut Data disables batch insert capability for MSSQL (code).
This is because MSSQL doesn't return generated primary keys for multiple inserts (I can reproduce this in plain JDBC). However, the batch insert functionality itself works fine in JDBC if you don't care about the returned IDs.
Could MSSQL batch inserts be enabled via a config flag like
micronaut.data.mssql-batch-inserts: true
? This gives users the choice.I understand if this isn't worth the added complexity. Users can still use Micronaut for JDBC transactions and fall back to plain JDBC + JDBI or similar.