From e845f2f905e8dab89703b07cbe33d1b0869a3647 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 27 Apr 2024 19:06:38 +0200 Subject: [PATCH] Set up the PreapredStatement for convenience in SQLite3QueryBuilder::create_prepared_statement(). --- modules/database_sqlite/sqlite3_query_builder.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/database_sqlite/sqlite3_query_builder.cpp b/modules/database_sqlite/sqlite3_query_builder.cpp index f11fe00d2..565a8198f 100644 --- a/modules/database_sqlite/sqlite3_query_builder.cpp +++ b/modules/database_sqlite/sqlite3_query_builder.cpp @@ -411,7 +411,13 @@ void SQLite3QueryBuilder::run_query() { Ref SQLite3QueryBuilder::create_prepared_statement() { ERR_FAIL_COND_V(!_connection.is_valid(), Ref()); - return _connection->create_prepared_statement(); + Ref stmt = _connection->create_prepared_statement(); + + if (stmt.is_valid()) { + stmt->set_sql(get_result()); + } + + return stmt; } QueryBuilder *SQLite3QueryBuilder::select_last_insert_id() {