
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
github.com/databricks/databricks-sql-go
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Critical CVE and High CVE
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.
See doc.go
for full documentation or the Databrick's documentation for SQL Driver for Go.
import (
"context"
"database/sql"
_ "github.com/databricks/databricks-sql-go"
)
db, err := sql.Open("databricks", "token:********@********.databricks.com:443/sql/1.0/endpoints/********")
if err != nil {
panic(err)
}
defer db.Close()
rows, err := db.QueryContext(context.Background(), "SELECT 1")
defer rows.Close()
Additional usage examples are available here.
The DSN format is:
token:[your token]@[Workspace hostname]:[Port number][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]:[Port number][Endpoint HTTP Path]?timeout=1000&maxRows=1000
You can turn on Cloud Fetch (now enabled by default) to increase the performance of extracting large query results by fetching data in parallel via cloud storage (more info here). You can also set the number of concurrently fetching goroutines by setting the maxDownloadThreads
query parameter (default is 10):
token:[your token]@[Workspace hostname]:[Port number][Endpoint HTTP Path]?useCloudFetch=true&maxDownloadThreads=3
To disable Cloud Fetch (e.g., when handling smaller datasets or to avoid additional overhead), append useCloudFetch=false
:
token:[your token]@[Workspace hostname]:[Port number][Endpoint HTTP Path]?useCloudFetch=false
You can also connect with a new connector object. For example:
import (
"database/sql"
_ "github.com/databricks/databricks-sql-go"
)
connector, err := dbsql.NewConnector(
dbsql.WithServerHostname(<Workspace hostname>),
dbsql.WithPort(<Port number>),
dbsql.WithHTTPPath(<Endpoint HTTP Path>),
dbsql.WithAccessToken(<your token>)
)
if err != nil {
log.Fatal(err)
}
db := sql.OpenDB(connector)
defer db.Close()
View doc.go
or connector.go
to understand all the functional options available when creating a new connector object.
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"
]
}
go test
If you find any issues, feel free to create an issue or send a pull request directly.
See CONTRIBUTING.md
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.