Closed goetas closed 4 years ago
A first idea could be to add isMultiTableTrucateSupported()
and relative methods in the DBAL package.
This should definitely be solved in DBAL. Since that will take time (and may even require a BC break to have getTruncateTableSQL
accept an array), it may be worth working around this restriction here for now. Other opinions @doctrine/doctrinecore?
I share same opinion
and may even require a BC break to have getTruncateTableSQL accept an array
Would be considered a BC break adding to the AbstractPlatform
class a new method getTruncateMultiTableSQL
?
Would be considered a BC break adding to the
AbstractPlatform
class a new methodgetTruncateMultiTableSQL
?
As long as the method isn't abstract
, I don't see a problem with that.
Will start with a PR there then!
I'm closing, but tell me if I need to reopen this.
Hi, this PR allows to truncate multiple tables with a single query when supported (postgres as example).
I'm pretty sure that is not really elegant, but it allowed us to have a test suite running in ~20s instead of 6m. I'm open for suggestions on how to improve it.
It would be nice to have
getTruncateTableSQL
allowing an array as table name...Did not write tests yet as I'm not sure that the current version is good and that will be considered at all for merging.
Feedback?