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

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 205 additions & 79 deletions connection.go

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestConn_executeStatement(t *testing.T) {
testClient := &client.TestClient{
FnExecuteStatement: executeStatement,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestConn_executeStatement(t *testing.T) {
testClient := &client.TestClient{
FnExecuteStatement: executeStatement,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand All @@ -102,7 +102,7 @@ func TestConn_pollOperation(t *testing.T) {
testClient := &client.TestClient{
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -132,7 +132,7 @@ func TestConn_pollOperation(t *testing.T) {
testClient := &client.TestClient{
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestConn_pollOperation(t *testing.T) {
testClient := &client.TestClient{
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestConn_pollOperation(t *testing.T) {
testClient := &client.TestClient{
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -222,7 +222,7 @@ func TestConn_pollOperation(t *testing.T) {
testClient := &client.TestClient{
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -254,7 +254,7 @@ func TestConn_pollOperation(t *testing.T) {
testClient := &client.TestClient{
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestConn_pollOperation(t *testing.T) {
FnGetOperationStatus: getOperationStatus,
FnCancelOperation: cancelOperation,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -342,7 +342,7 @@ func TestConn_pollOperation(t *testing.T) {
}
cfg := config.WithDefaults()
cfg.PollInterval = 100 * time.Millisecond
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: cfg,
Expand Down Expand Up @@ -388,7 +388,7 @@ func TestConn_pollOperation(t *testing.T) {
}
cfg := config.WithDefaults()
cfg.PollInterval = 100 * time.Millisecond
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: cfg,
Expand Down Expand Up @@ -423,7 +423,7 @@ func TestConn_runQuery(t *testing.T) {
testClient := &client.TestClient{
FnExecuteStatement: executeStatement,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -465,7 +465,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -509,7 +509,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -553,7 +553,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -605,7 +605,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -657,7 +657,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -709,7 +709,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -761,7 +761,7 @@ func TestConn_runQuery(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand All @@ -782,7 +782,7 @@ func TestConn_ExecContext(t *testing.T) {
var executeStatementCount int

testClient := &client.TestClient{}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -817,7 +817,7 @@ func TestConn_ExecContext(t *testing.T) {
testClient := &client.TestClient{
FnExecuteStatement: executeStatement,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -860,7 +860,7 @@ func TestConn_ExecContext(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand All @@ -881,7 +881,7 @@ func TestConn_QueryContext(t *testing.T) {
var executeStatementCount int

testClient := &client.TestClient{}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -916,7 +916,7 @@ func TestConn_QueryContext(t *testing.T) {
testClient := &client.TestClient{
FnExecuteStatement: executeStatement,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -959,7 +959,7 @@ func TestConn_QueryContext(t *testing.T) {
FnExecuteStatement: executeStatement,
FnGetOperationStatus: getOperationStatus,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -994,7 +994,7 @@ func TestConn_Ping(t *testing.T) {
testClient := &client.TestClient{
FnExecuteStatement: executeStatement,
}
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand Down Expand Up @@ -1037,7 +1037,7 @@ func TestConn_Ping(t *testing.T) {
FnGetOperationStatus: getOperationStatus,
}

testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: testClient,
cfg: config.WithDefaults(),
Expand All @@ -1051,7 +1051,7 @@ func TestConn_Ping(t *testing.T) {

func TestConn_Begin(t *testing.T) {
t.Run("Begin not supported", func(t *testing.T) {
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: &client.TestClient{},
cfg: config.WithDefaults(),
Expand All @@ -1064,7 +1064,7 @@ func TestConn_Begin(t *testing.T) {

func TestConn_BeginTx(t *testing.T) {
t.Run("BeginTx not supported", func(t *testing.T) {
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: &client.TestClient{},
cfg: config.WithDefaults(),
Expand All @@ -1077,7 +1077,7 @@ func TestConn_BeginTx(t *testing.T) {

func TestConn_ResetSession(t *testing.T) {
t.Run("ResetSession not currently supported", func(t *testing.T) {
testConn := &conn{
testConn := &Conn{
session: getTestSession(),
client: &client.TestClient{},
cfg: config.WithDefaults(),
Expand Down
2 changes: 1 addition & 1 deletion connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *connector) Connect(ctx context.Context) (driver.Conn, error) {
return nil, errors.New("databricks: invalid open session response")
}

conn := &conn{
conn := &Conn{
id: client.SprintGuid(session.SessionHandle.GetSessionId().GUID),
cfg: c.cfg,
client: tclient,
Expand Down
Loading