harbor run -t openthoughts/tasktrove-exp-rpt-stack-go-v4-stack-go-1968harbor download openthoughts/tasktrove-exp-rpt-stack-go-v4-stack-go-1968Implement functionality for a mock SQL database driver in Go that passes the provided test suite. The implementation should reside in the /app/ directory and adhere to the following requirements:
Driver Behavior: Create a mock driver that simulates a SQL database connection (Conn), prepared statements (Stmt), and transactions (Tx). Make sure to implement necessary interfaces for driver operations, including driver.Driver, driver.Conn, driver.Tx, driver.Stmt, etc.
Connection Management: Implement logic for opening, closing, and managing connections. Ensure that connections can be pooled, reused, and should have a configurable maximum idle time and lifespan.
Query Execution: Support execution of queries with the ability to handle named parameters. Implement Query, Exec, QueryRow, and other relevant methods accurately.
Error Handling: Return appropriate errors, including simulating 'bad connection' scenarios where necessary, such as when the driver should fail to execute due to connection issues.
Transaction Support: Ensure that transactions can be begun, committed, and rolled back. Implement cancellation of transactions via context properly, ensuring that transactions don't leave connections open unintentionally.
Context Support: Implement context-aware methods for queries and transactions that allow canceling operations.
Concurrency: Your driver must handle concurrent access to the connections safely, ensuring that multiple goroutines can perform queries and updates without causing deadlocks or data races.
Unit Tests: Ensure that your implementation passes all provided test cases, which include tests for various operations, error handling, concurrency, and resource management.
Performance Benchmarks: Create benchmarks to test the performance of your driver under different scenarios, especially focusing on concurrent queries.
Documentation: Provide clear comments and documentation in your code explaining the purpose and function of each component.
Place your implementation of the driver in the /app/ directory, ensuring it adheres to Go coding standards and practices.
Important: declare your solution in package sql (the test file uses package sql, so the implementation must use the matching package name).