31 lines
		
	
	
		
			881 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			881 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| #include <ctime>
 | |
| #include <sqlite3.h>
 | |
| #include <string>
 | |
| #include <util/date.hpp>
 | |
| 
 | |
| namespace Database
 | |
| {
 | |
|     class Connection {
 | |
|     private:
 | |
|         sqlite3 * const connectionPtr;
 | |
| 
 | |
|     public:
 | |
|         Connection(sqlite3 * const databaseConnectionPtr);
 | |
| 
 | |
|         // Date should be in format yyyy-mm-dd
 | |
|         // Returns a JSON array
 | |
|         std::string GetEntireDay(Util::Date const & date);
 | |
| 
 | |
|         // Dates should be in format yyyy-mm-dd
 | |
|         // Returns a JSON array
 | |
|         // startDate and endDate are inclusive
 | |
|         std::string GetSummarizedPerDayRecords(Util::Date const & startDate, Util::Date const & endDate);
 | |
| 
 | |
|         // Dates should be in format yyyy-mm-dd
 | |
|         // Returns a JSON array
 | |
|         // startDate and endDate are inclusive
 | |
|         std::string GetSummarizedPerMonthRecords(Util::Date const & startDate, Util::Date const & endDate);
 | |
|     };
 | |
| }
 |