Skip to content

carl-db/databricks-sql-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Databricks SQL Driver for Go (Beta)

http://www.apache.org/licenses/LICENSE-2.0.txt

Description

This repo contains a Databricks SQL Driver for Go's database/sql package. It can be used to connect and query Databricks clusters and SQL Warehouses.

NOTE: This Driver is Beta.

Documentation

Full documentation is not yet available. See below for usage examples.

Usage

import (
	"database/sql"
	"time"

	_ "github.com/databricks/databricks-sql-go"
)

db, err := sql.Open("databricks", "token:********@********.databricks.com/sql/1.0/endpoints/********")
if err != nil {
	panic(err)
}


rows, err := db.Query("SELECT 1")

Additional usage examples are available here.

DSN (Data Source Name)

The DSN format is:

token:[your token]@[Workspace hostname][Endpoint HTTP Path]?param=value

You can set query timeout value by appending a timeout query parameter (in seconds) and you can set max rows to retrieve per network request by setting the maxRows query parameter:

token:[your token]@[Workspace hostname][Endpoint HTTP Path]?timeout=1000&maxRows=1000

Develop

Lint

We use golangci-lint as the lint tool. If you use vs code, just add the following settings:

{
    "go.lintTool": "golangci-lint",
    "go.lintFlags": [
        "--fast"
    ]
}

Unit Tests

go test

Issues

If you find any issues, feel free to create an issue or send a pull request directly.

Contributing

See CONTRIBUTING.md

License

Apache 2.0

About

Golang database/sql driver for Databricks SQL.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.7%
  • Makefile 1.3%