From 881e93e0f61320dd75fbb7c12e592c819eade360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20K=C3=BChl?= Date: Tue, 10 Feb 2026 16:30:39 +0100 Subject: [PATCH] added markers for handling insert --- backends/postgres/src/postgres_connection.cpp | 3 +++ backends/postgres/src/postgres_statement.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/backends/postgres/src/postgres_connection.cpp b/backends/postgres/src/postgres_connection.cpp index 9c00f99..c6169d3 100644 --- a/backends/postgres/src/postgres_connection.cpp +++ b/backends/postgres/src/postgres_connection.cpp @@ -143,6 +143,9 @@ utils::result, utils::error> postgres_conne } utils::result postgres_connection::execute(const sql::query_context &context) { + if (context.command == sql::sql_command::Insert) { + // handle insert command with the primary key generator strategy + } PGresult *res = PQexec(conn_, context.sql.c_str()); if (const auto status = PQresultStatus(res); status != PGRES_COMMAND_OK && status != PGRES_TUPLES_OK) { diff --git a/backends/postgres/src/postgres_statement.cpp b/backends/postgres/src/postgres_statement.cpp index 1320c6a..216f510 100644 --- a/backends/postgres/src/postgres_statement.cpp +++ b/backends/postgres/src/postgres_statement.cpp @@ -23,6 +23,11 @@ utils::result postgres_statement::execute(con if (!postgres_bindings) { return utils::failure(utils::error(sql::error_code::EXECUTE_FAILED, "Failed to cast bindings to postgres bindings")); } + + if (query_.command == sql::sql_command::Insert) { + // handle insert command with the primary key generator strategy + } + PGresult *res = PQexecPrepared(db_, name_.c_str(), static_cast(postgres_bindings->params().values.size()),