Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions client/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,17 @@ func (s *Session) ExecuteStatement(sql string) (*SessionDataSet, error) {
return s.ExecuteStatementWithContext(context.Background(), sql)
}

func (s *Session) Ping(ctx context.Context) error {
status, err := s.client.TestConnectionEmptyRPC(ctx)
if err != nil {
return err
}
if status.GetCode() == SuccessStatus {
return nil
}
return errors.New("Ping failed: " + status.GetMessage())
}

func (s *Session) ExecuteNonQueryStatement(sql string) (r *common.TSStatus, err error) {
request := rpc.TSExecuteStatementReq{
SessionId: s.sessionId,
Expand Down
2 changes: 2 additions & 0 deletions database/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
vendor
30 changes: 30 additions & 0 deletions database/batch.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package iotdb_go

import (
"context"
"database/sql/driver"
"github.com/pkg/errors"
)

type stdBatch struct {
debugf func(format string, v ...any)
}

func (s *stdBatch) NumInput() int { return -1 }

func (s *stdBatch) Exec(args []driver.Value) (driver.Result, error) {
return nil, errors.New("not implemented")
}

func (s *stdBatch) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {
return nil, driver.ErrSkip
}

func (s *stdBatch) Query(args []driver.Value) (driver.Rows, error) {
// Note: not implementing driver.StmtQueryContext accordingly
return nil, errors.New("only Exec method supported in batch mode")
}

func (s *stdBatch) Close() error {
return nil
}
Loading
Loading