GetBufferedModel returns the model as it would look after applying all buffered operations. This is useful for preview or validation purposes within the transaction.
()
| 382 | // GetBufferedModel returns the model as it would look after applying all buffered operations. |
| 383 | // This is useful for preview or validation purposes within the transaction. |
| 384 | func (tx *Transaction) GetBufferedModel() (model.Model, error) { |
| 385 | tx.mutex.RLock() |
| 386 | defer tx.mutex.RUnlock() |
| 387 | |
| 388 | if err := tx.checkTransactionStatus(); err != nil { |
| 389 | return nil, err |
| 390 | } |
| 391 | |
| 392 | return tx.buffer.ApplyOperationsToModel(tx.buffer.GetModelSnapshot()) |
| 393 | } |
| 394 | |
| 395 | // HasOperations returns true if the transaction has any buffered operations. |
| 396 | func (tx *Transaction) HasOperations() bool { |