MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / Insert

Method Insert

client/tablesessionpool.go:103–118  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

101// Returns:
102// - err: An error if an issue occurs during the operation.
103func (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//

Callers

nothing calls this directly

Calls 3

isConnectionErrorFunction · 0.85
dropSessionMethod · 0.80

Tested by

no test coverage detected