Skip to content

Latest commit

 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Databricks Modular SDKs for Go (Beta)

Note

Beta

This SDK is in Beta and is supported for production use cases. Interfaces might still change slightly before GA (e.g. name standardization and minor ergonomic tweaks). We are keen to hear feedback from early adopters — please file issues, and we will address them.

The Databricks SDKs for Go provide typed clients for the Databricks REST API. They have a modular architecture, with a separate Go module for each API (for example, github.com/databricks/sdk-go/postgres).

Table of Contents

Installation

The SDK requires Go 1.26 or later. Install the module for each API you need. For example, to work with Postgres:

go get github.com/databricks/sdk-go/postgres@latest

Authentication

By default, a client reads its host and credentials from a Databricks configuration profile (~/.databrickscfg) and DATABRICKS_* environment variables. With those set, no credentials need to be passed in code:

import "github.com/databricks/sdk-go/postgres/v1"

postgresClient, err := postgres.NewClient(ctx)
if err != nil {
	return err
}

To configure credentials explicitly, create credentials with github.com/databricks/sdk-go/auth/credentials and pass client options from github.com/databricks/sdk-go/options/client:

import (
	"github.com/databricks/sdk-go/auth/credentials"
	clientopts "github.com/databricks/sdk-go/options/client"
	"github.com/databricks/sdk-go/postgres/v1"
)

pat, err := credentials.NewPATCredentials("<personal-access-token>")
if err != nil {
	return err
}
postgresClient, err := postgres.NewClient(
	ctx,
	clientopts.WithHost("https://example.cloud.databricks.com"),
	clientopts.WithCredentials(pat),
)
if err != nil {
	return err
}

Example

The following lists the Postgres projects you can access, using the default authentication described above. Iterator methods page through results transparently:

import (
	"context"
	"fmt"

	"github.com/databricks/sdk-go/postgres/v1"
)

func listProjects(ctx context.Context) error {
	postgresClient, err := postgres.NewClient(ctx)
	if err != nil {
		return err
	}
	for project, err := range postgresClient.ListProjectsIter(ctx, postgres.ListProjectsRequest{}) {
		if err != nil {
			return err
		}
		fmt.Println(project)
	}
	return nil
}

Additional runnable examples are available in examples and package-specific example directories such as files/examples.

Modules

Each Databricks API is published as a separate module named github.com/databricks/sdk-go/<api>. Import its client from the module's versioned package — for example, github.com/databricks/sdk-go/postgres/v1 exports postgres.Client.

Module Documentation
github.com/databricks/sdk-go/accessmanagement Go Reference
github.com/databricks/sdk-go/aifunctions Go Reference
github.com/databricks/sdk-go/aigateway Go Reference
github.com/databricks/sdk-go/aisearch Go Reference
github.com/databricks/sdk-go/alerts Go Reference
github.com/databricks/sdk-go/apps Go Reference
github.com/databricks/sdk-go/authentication Go Reference
github.com/databricks/sdk-go/budgetpolicy Go Reference
github.com/databricks/sdk-go/budgets Go Reference
github.com/databricks/sdk-go/cleanrooms Go Reference
github.com/databricks/sdk-go/clusterlibraries Go Reference
github.com/databricks/sdk-go/clusterpolicies Go Reference
github.com/databricks/sdk-go/clusters Go Reference
github.com/databricks/sdk-go/commandexecution Go Reference
github.com/databricks/sdk-go/customllms Go Reference
github.com/databricks/sdk-go/database Go Reference
github.com/databricks/sdk-go/dataclassification Go Reference
github.com/databricks/sdk-go/dataquality Go Reference
github.com/databricks/sdk-go/disasterrecovery Go Reference
github.com/databricks/sdk-go/domains Go Reference
github.com/databricks/sdk-go/environments Go Reference
github.com/databricks/sdk-go/experiments Go Reference
github.com/databricks/sdk-go/features Go Reference
github.com/databricks/sdk-go/featurestore Go Reference
github.com/databricks/sdk-go/files Go Reference
github.com/databricks/sdk-go/forecasting Go Reference
github.com/databricks/sdk-go/genie Go Reference
github.com/databricks/sdk-go/gitcredentials Go Reference
github.com/databricks/sdk-go/globalinitscripts Go Reference
github.com/databricks/sdk-go/instancepools Go Reference
github.com/databricks/sdk-go/instanceprofiles Go Reference
github.com/databricks/sdk-go/jobs Go Reference
github.com/databricks/sdk-go/keyconfigurations Go Reference
github.com/databricks/sdk-go/knowledgeassistants Go Reference
github.com/databricks/sdk-go/lakeview Go Reference
github.com/databricks/sdk-go/logdelivery Go Reference
github.com/databricks/sdk-go/marketplaces Go Reference
github.com/databricks/sdk-go/modelregistry Go Reference
github.com/databricks/sdk-go/modelserving Go Reference
github.com/databricks/sdk-go/modelservingquery Go Reference
github.com/databricks/sdk-go/networking Go Reference
github.com/databricks/sdk-go/notificationdestinations Go Reference
github.com/databricks/sdk-go/oauth Go Reference
github.com/databricks/sdk-go/pipelines Go Reference
github.com/databricks/sdk-go/policyfamilies Go Reference
github.com/databricks/sdk-go/postgres Go Reference
github.com/databricks/sdk-go/queries Go Reference
github.com/databricks/sdk-go/queryhistory Go Reference
github.com/databricks/sdk-go/repos Go Reference
github.com/databricks/sdk-go/sandbox Go Reference
github.com/databricks/sdk-go/scim Go Reference
github.com/databricks/sdk-go/secrets Go Reference
github.com/databricks/sdk-go/settings Go Reference
github.com/databricks/sdk-go/sharing Go Reference
github.com/databricks/sdk-go/statementexecution Go Reference
github.com/databricks/sdk-go/storageconfigurations Go Reference
github.com/databricks/sdk-go/supervisoragents Go Reference
github.com/databricks/sdk-go/tagassignments Go Reference
github.com/databricks/sdk-go/tagpolicies Go Reference
github.com/databricks/sdk-go/tokenmanagement Go Reference
github.com/databricks/sdk-go/tokens Go Reference
github.com/databricks/sdk-go/uc/abacpolicies Go Reference
github.com/databricks/sdk-go/uc/artifactallowlists Go Reference
github.com/databricks/sdk-go/uc/catalogs Go Reference
github.com/databricks/sdk-go/uc/connections Go Reference
github.com/databricks/sdk-go/uc/credentials Go Reference
github.com/databricks/sdk-go/uc/entitytagassignments Go Reference
github.com/databricks/sdk-go/uc/externallineage Go Reference
github.com/databricks/sdk-go/uc/externallocations Go Reference
github.com/databricks/sdk-go/uc/externalmetadata Go Reference
github.com/databricks/sdk-go/uc/functions Go Reference
github.com/databricks/sdk-go/uc/grants Go Reference
github.com/databricks/sdk-go/uc/metastores Go Reference
github.com/databricks/sdk-go/uc/onlinetables Go Reference
github.com/databricks/sdk-go/uc/registeredmodels Go Reference
github.com/databricks/sdk-go/uc/resourcequotas Go Reference
github.com/databricks/sdk-go/uc/rfa Go Reference
github.com/databricks/sdk-go/uc/schemas Go Reference
github.com/databricks/sdk-go/uc/secrets Go Reference
github.com/databricks/sdk-go/uc/systemschemas Go Reference
github.com/databricks/sdk-go/uc/tables Go Reference
github.com/databricks/sdk-go/uc/volumes Go Reference
github.com/databricks/sdk-go/uc/workspacebindings Go Reference
github.com/databricks/sdk-go/usagedashboards Go Reference
github.com/databricks/sdk-go/vectorsearch Go Reference
github.com/databricks/sdk-go/warehouses Go Reference
github.com/databricks/sdk-go/workspaces Go Reference

Shared modules

Three modules are shared by every API client and provide the pieces you import directly:

License

This project is licensed under the Apache License 2.0. See LICENSE and NOTICE.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages