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

Method InsertStringRecord

client/session.go:461–477  ·  view source on GitHub ↗

* *special case for inserting one row of String (TEXT) value *params *deviceId: string, time series path for device *measurements: []string, sensor names *values: []string, values to be inserted, for each sensor *timestamp: int64, indicate the timestamp of the row of data *return *error: cor

(deviceId string, measurements []string, values []string, timestamp int64)

Source from the content-addressed store, hash-verified

459 *error: correctness of operation
460 */
461func (s *Session) InsertStringRecord(deviceId string, measurements []string, values []string, timestamp int64) error {
462 request := rpc.TSInsertStringRecordReq{
463 SessionId: s.sessionId, PrefixPath: deviceId, Measurements: measurements,
464 Values: values, Timestamp: timestamp,
465 }
466 r, err := s.client.InsertStringRecord(context.Background(), &request)
467 if err != nil && r == nil {
468 if s.reconnect() {
469 request.SessionId = s.sessionId
470 r, err = s.client.InsertStringRecord(context.Background(), &request)
471 }
472 }
473 if err != nil {
474 return err
475 }
476 return VerifySuccess(r)
477}
478
479func (s *Session) GetTimeZone() (string, error) {
480 resp, err := s.client.GetTimeZone(context.Background(), s.sessionId)

Callers

nothing calls this directly

Calls 3

reconnectMethod · 0.95
VerifySuccessFunction · 0.85
InsertStringRecordMethod · 0.65

Tested by

no test coverage detected