mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-25 01:56:41 +00:00 
			
		
		
		
	Use "pragma max_page_count" to define max allowed file size in combination with "pragma page_size" based on a new setting "max navmeshdb file size". * Stop navmeshtool on the first db error. * Disable writes to db in the engine on first "database or disk is full" SQLite3 error. There is no special error code for this error. * Change default "write to navmeshdb" to true. * Use time intervals for transaction duration instead of number of changes.
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			588 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			588 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef OPENMW_COMPONENTS_SQLITE3_TRANSACTION_H
 | |
| #define OPENMW_COMPONENTS_SQLITE3_TRANSACTION_H
 | |
| 
 | |
| #include <memory>
 | |
| 
 | |
| struct sqlite3;
 | |
| 
 | |
| namespace Sqlite3
 | |
| {
 | |
|     struct Rollback
 | |
|     {
 | |
|         void operator()(sqlite3* handle) const;
 | |
|     };
 | |
| 
 | |
|     enum class TransactionMode
 | |
|     {
 | |
|         Default,
 | |
|         Deferred,
 | |
|         Immediate,
 | |
|         Exclusive,
 | |
|     };
 | |
| 
 | |
|     class Transaction
 | |
|     {
 | |
|     public:
 | |
|         explicit Transaction(sqlite3& db, TransactionMode mode = TransactionMode::Default);
 | |
| 
 | |
|         void commit();
 | |
| 
 | |
|     private:
 | |
|         std::unique_ptr<sqlite3, Rollback> mDb;
 | |
|     };
 | |
| }
 | |
| 
 | |
| #endif
 |