TODO: Update the function to get rid of the Database after refactoring
| 718 | |
| 719 | // TODO: Update the function to get rid of the Database after refactoring |
| 720 | Reference<ITransaction> getTransaction(Reference<IDatabase> db, |
| 721 | Reference<ITenant> tenant, |
| 722 | Reference<ITransaction>& tr, |
| 723 | FdbOptions* options, |
| 724 | bool intrans) { |
| 725 | // Update "tr" to point to a brand new transaction object when it's not initialized or "intrans" flag is "false", |
| 726 | // which indicates we need a new transaction object |
| 727 | if (!tr || !intrans) { |
| 728 | if (tenant) { |
| 729 | tr = tenant->createTransaction(); |
| 730 | } else { |
| 731 | tr = db->createTransaction(); |
| 732 | } |
| 733 | options->apply(tr); |
| 734 | } |
| 735 | |
| 736 | return tr; |
| 737 | } |
| 738 | |
| 739 | std::string newCompletion(const char* base, const char* name) { |
| 740 | return format("%s%s ", base, name); |
no test coverage detected