| 686 | } |
| 687 | |
| 688 | UInt64 PostgreSQLHandler::executeQueryWithTracking( |
| 689 | String && sql_query, |
| 690 | ContextMutablePtr query_context, |
| 691 | PostgreSQLProtocol::Messaging::CommandComplete::Command command) |
| 692 | { |
| 693 | // Track affected rows using progress callback (similar to MySQL handler) |
| 694 | std::atomic<UInt64> result_rows {0}; |
| 695 | std::atomic<UInt64> written_rows {0}; |
| 696 | query_context->setProgressCallback(createProgressCallback(query_context, result_rows, written_rows)); |
| 697 | |
| 698 | // Execute query with PostgreSQLWire output format |
| 699 | auto read_buf = std::make_unique<ReadBufferFromOwnString>(std::move(sql_query)); |
| 700 | executeQuery(std::move(read_buf), *out, query_context, {}); |
| 701 | |
| 702 | // Determine affected rows based on command type |
| 703 | return (command == PostgreSQLProtocol::Messaging::CommandComplete::Command::INSERT) |
| 704 | ? written_rows.load() |
| 705 | : result_rows.load(); |
| 706 | } |
| 707 | |
| 708 | bool PostgreSQLHandler::processPrepareStatement(const String & query) |
| 709 | { |
nothing calls this directly
no test coverage detected