ExecuteQueryStatement executes a query SQL statement and returns the result set. Parameters: - sql: The SQL query statement to execute. - timeoutInMs: A pointer to the timeout duration in milliseconds for query execution. Returns: - result: A pointer to SessionDataSet containing the query results.
(sql string, timeoutInMs *int64)
| 151 | // - result: A pointer to SessionDataSet containing the query results. |
| 152 | // - err: An error if an issue occurs during the operation. |
| 153 | func (s *PooledTableSession) ExecuteQueryStatement(sql string, timeoutInMs *int64) (*SessionDataSet, error) { |
| 154 | if atomic.LoadInt32(&s.closed) == 1 { |
| 155 | return nil, ErrTableSessionClosed |
| 156 | } |
| 157 | sessionDataSet, err := s.session.ExecuteQueryStatement(sql, timeoutInMs) |
| 158 | if err == nil { |
| 159 | return sessionDataSet, nil |
| 160 | } |
| 161 | if isConnectionError(err) { |
| 162 | if atomic.CompareAndSwapInt32(&s.closed, 0, 1) { |
| 163 | s.sessionPool.dropSession(s.session) |
| 164 | s.session = Session{} |
| 165 | } |
| 166 | } |
| 167 | return nil, err |
| 168 | } |
| 169 | |
| 170 | // Close closes the PooledTableSession, releasing it back to the pool. |
| 171 | // |
nothing calls this directly
no test coverage detected