@@ -146,7 +146,7 @@ namespace sqlite_orm {
146146 context_t context{this ->db_objects };
147147 statement_serializer<Table, void > serializer;
148148 const std::string sql = serializer.serialize (table, context, tableName);
149- this ->executor .perform_void_exec (db, sql.data ());
149+ this ->executor .perform_void_exec (db, sql.c_str ());
150150 }
151151
152152 /* *
@@ -169,7 +169,7 @@ namespace sqlite_orm {
169169 << streaming_identifier (columnName) << std::flush;
170170 sql = ss.str ();
171171 }
172- this ->executor .perform_void_exec (db, sql.data ());
172+ this ->executor .perform_void_exec (db, sql.c_str ());
173173 }
174174#endif
175175
@@ -278,8 +278,8 @@ namespace sqlite_orm {
278278 mapped_view<O, self_type, Args...> iterate(Args&&... args) {
279279 this ->assert_mapped_type <O>();
280280
281- auto connection = this ->get_connection ();
282- return {*this , std::move (connection ), std::forward<Args>(args)...};
281+ auto conRef = this ->get_connection ();
282+ return {*this , std::move (conRef ), std::forward<Args>(args)...};
283283 }
284284
285285#ifdef SQLITE_ORM_WITH_CPP20_ALIASES
@@ -313,8 +313,8 @@ namespace sqlite_orm {
313313 if constexpr (is_select_v<Select>) {
314314 expression.highest_level = true ;
315315 }
316- auto con = this ->get_connection ();
317- return {this ->db_objects , std::move (con ), std::move (expression)};
316+ auto conRef = this ->get_connection ();
317+ return {this ->db_objects , std::move (conRef ), std::move (expression)};
318318 }
319319
320320#ifdef SQLITE_ORM_CPP23_GENERATOR_SUPPORTED
@@ -1235,7 +1235,7 @@ namespace sqlite_orm {
12351235 << serialize (column, context) << std::flush;
12361236 sql = ss.str ();
12371237 }
1238- this ->executor .perform_void_exec (db, sql.data ());
1238+ this ->executor .perform_void_exec (db, sql.c_str ());
12391239 }
12401240
12411241 template <class ColResult , class S >
@@ -1286,10 +1286,10 @@ namespace sqlite_orm {
12861286 context.omit_table_name = false ;
12871287 context.replace_bindable_with_question = true ;
12881288
1289- auto conection = this ->get_connection ();
12901289 const std::string sql = serialize (statement, context);
1291- sqlite3_stmt* stmt = prepare_stmt (conection.get (), sql);
1292- return prepared_statement_t <S>{std::forward<S>(statement), stmt, std::move (conection)};
1290+ auto conRef = this ->get_connection ();
1291+ sqlite3_stmt* stmt = prepare_stmt (conRef.get (), sql);
1292+ return prepared_statement_t <S>{std::forward<S>(statement), stmt, std::move (conRef)};
12931293 }
12941294
12951295 public:
@@ -1321,9 +1321,9 @@ namespace sqlite_orm {
13211321 * can be printed out on std::ostream with `operator<<`.
13221322 */
13231323 std::map<std::string, sync_schema_result> sync_schema (bool preserve = false ) {
1324- auto con = this ->get_connection ();
1324+ auto conRef = this ->get_connection ();
13251325 std::map<std::string, sync_schema_result> result;
1326- iterate_tuple<true >(this ->db_objects , [this , db = con .get (), preserve, &result](auto & schemaObject) {
1326+ iterate_tuple<true >(this ->db_objects , [this , db = conRef .get (), preserve, &result](auto & schemaObject) {
13271327 sync_schema_result status = this ->sync_dbo (schemaObject, db, preserve);
13281328 result.emplace (schemaObject.name , status);
13291329 });
@@ -1336,9 +1336,9 @@ namespace sqlite_orm {
13361336 * what will happen if you sync your schema.
13371337 */
13381338 std::map<std::string, sync_schema_result> sync_schema_simulate (bool preserve = false ) {
1339- auto con = this ->get_connection ();
1339+ auto conRef = this ->get_connection ();
13401340 std::map<std::string, sync_schema_result> result;
1341- iterate_tuple<true >(this ->db_objects , [this , db = con .get (), preserve, &result](auto & schemaObject) {
1341+ iterate_tuple<true >(this ->db_objects , [this , db = conRef .get (), preserve, &result](auto & schemaObject) {
13421342 sync_schema_result status = this ->schema_status (schemaObject, db, preserve, nullptr );
13431343 result.emplace (schemaObject.name , status);
13441344 });
0 commit comments