Insert inserts a Tablet into the database. Parameters: - tablet: A pointer to a Tablet containing time-series data to be inserted. Returns: - err: An error if an issue occurs during the operation.
(tablet *Tablet)
| 101 | // Returns: |
| 102 | // - err: An error if an issue occurs during the operation. |
| 103 | func (s *PooledTableSession) Insert(tablet *Tablet) error { |
| 104 | if atomic.LoadInt32(&s.closed) == 1 { |
| 105 | return ErrTableSessionClosed |
| 106 | } |
| 107 | err := s.session.insertRelationalTablet(tablet) |
| 108 | if err == nil { |
| 109 | return nil |
| 110 | } |
| 111 | if isConnectionError(err) { |
| 112 | if atomic.CompareAndSwapInt32(&s.closed, 0, 1) { |
| 113 | s.sessionPool.dropSession(s.session) |
| 114 | s.session = Session{} |
| 115 | } |
| 116 | } |
| 117 | return err |
| 118 | } |
| 119 | |
| 120 | // ExecuteNonQueryStatement executes a non-query SQL statement, such as a DDL or DML command. |
| 121 | // |
nothing calls this directly
no test coverage detected