|
11 | 11 | #include <sqlite3.h> |
12 | 12 | #include <sstream> |
13 | 13 | #include <unistd.h> |
| 14 | +#include "specs/HybridNitroSQLiteQueryResult.hpp" |
14 | 15 |
|
15 | 16 | using namespace facebook; |
16 | 17 | using namespace margelo::nitro; |
@@ -121,7 +122,7 @@ void bindStatement(sqlite3_stmt* statement, const SQLiteQueryParams& values) { |
121 | 122 | } |
122 | 123 | } |
123 | 124 |
|
124 | | -SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::string& query, |
| 125 | +std::shared_ptr<HybridNitroSQLiteQueryResult> sqliteExecute(const std::string& dbName, const std::string& query, |
125 | 126 | const std::optional<SQLiteQueryParams>& params) { |
126 | 127 | if (dbMap.count(dbName) == 0) { |
127 | 128 | throw NitroSQLiteException::DatabaseNotOpen(dbName); |
@@ -229,10 +230,7 @@ SQLiteExecuteQueryResult sqliteExecute(const std::string& dbName, const std::str |
229 | 230 |
|
230 | 231 | int rowsAffected = sqlite3_changes(db); |
231 | 232 | long long latestInsertRowId = sqlite3_last_insert_rowid(db); |
232 | | - return {.rowsAffected = rowsAffected, |
233 | | - .insertId = static_cast<double>(latestInsertRowId), |
234 | | - .results = std::move(results), |
235 | | - .metadata = std::move(metadata)}; |
| 233 | + return std::make_shared<HybridNitroSQLiteQueryResult>(results, static_cast<double>(latestInsertRowId), rowsAffected, metadata); |
236 | 234 | } |
237 | 235 |
|
238 | 236 | SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std::string& query) { |
@@ -288,3 +286,4 @@ SQLiteOperationResult sqliteExecuteLiteral(const std::string& dbName, const std: |
288 | 286 | } |
289 | 287 |
|
290 | 288 | } // namespace margelo::rnnitrosqlite |
| 289 | + |
0 commit comments