Conversation
Do you means this change only works for Postgres? If true, this is not acceptable, we need to keep support other databases. |
|
|
||
|
|
||
| // RebuildBatched rebuild nodes as any nestedset which in the scope | ||
| // ```nestedset.RebuildBatched(db, &node, true, 1000)``` will rebuild [&node] as nestedset |
There was a problem hiding this comment.
Or, we need to add a doc here to describe the limitation.
|
Thanks for the quick review.
Technically the library can't be used for mysql or sql server as it uses Also, another limitation is that if the table has non-null constraint with no default value, it fails with |
|
Yes, I forget that. |
|
Thank you |
Original
Rebuildwas making thousands of individual update queries. I addedRebuildBatchedwhich can becalled as:
The method is postgres specific. And can be used by adding following to
go.modfile:If the model has required fields, it will fail with
ERROR: null value in column \"my_column" of relation \"my_table\" violates not-null constraint (SQLSTATE 23502). The workaround is to set default values or make columns nullable which is not great but may worth the change.