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()),