Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenMetadata Go SDK

The official Go client for OpenMetadata — the open-source data catalog and metadata platform for data discovery, lineage, governance, data quality, and AI context.

Typed access to 50+ entity services (tables, dashboards, pipelines, glossaries, domains, data contracts, test cases, and more) with automatic pagination, retries, and JSON Patch support.

Go Reference

Looking for the Python SDK? It ships in the openmetadata-ingestion package — see docs.open-metadata.org/latest/sdk/python. For AI agents and MCP, see ai-sdk. This repository is the Go client.

Install

go get github.com/open-metadata/openmetadata-sdk/openmetadata-go-client@latest

Client releases track OpenMetadata server versions — use the client version matching your server (server 1.13.x → client v1.13.x).

Quick start

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/open-metadata/openmetadata-sdk/openmetadata-go-client/pkg/ometa"
)

func main() {
	client := ometa.NewClient(
		"http://localhost:8585",
		ometa.WithToken("<JWToken>"),
	)

	ctx := context.Background()

	// Fetch a table by fully qualified name
	table, err := client.Tables.GetByName(ctx, "sample_data.ecommerce_db.shopify.raw_product_catalog", nil)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(table.Name)

	// List returns an iterator — pagination is handled for you
	for t, err := range client.Tables.List(ctx, nil) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(t.Name)
	}
}

Get a token from Settings → Bots → ingestion-bot in the OpenMetadata UI.

Every service, one pattern

All 50+ services expose the same methods:

List · GetByID · GetByName · Create · CreateOrUpdate · Patch · Delete · DeleteByName · ListVersions · GetVersion · Restore
// Create
table, err := client.Tables.Create(ctx, &ometa.CreateTable{
	Name:           "my_table",
	DatabaseSchema: "service.database.schema",
	Columns: []ometa.Column{
		{Name: "id", DataType: ometa.ColumnDataTypeINT},
		{Name: "name", DataType: ometa.ColumnDataTypeSTRING},
	},
})

// Patch (JSON Patch)
table, err = client.Tables.Patch(ctx, "<id>", []ometa.JSONPatchOp{
	{Op: "add", Path: "/description", Value: "Updated description"},
})

Services include: Tables, Topics, Dashboards, Pipelines, Charts, Containers, SearchIndexes, Metrics, StoredProcedures, Databases, DatabaseSchemas, APICollections, APIEndpoints, Glossaries, GlossaryTerms, Classifications, Tags, DataProducts, Domains, DataContracts, Policies, TestCases, TestSuites, TestDefinitions, Users, Teams, Roles, Personas, Bots, IngestionPipelines, EventSubscriptions, WorkflowDefinitions, and more.

Client options

Option Description Default
WithToken(token) Authentication token ""
WithAPIVersion(v) Override API version "v1"
WithRetry(count, wait) Retry behavior 3 retries, 30s wait
WithHTTPClient(c) Custom *http.Client Default http.Client

Retries apply to 429 Too Many Requests and 504 Gateway Timeout.

Pointer helpers

Optional fields use pointers. Helpers are provided:

ometa.Str("value")   // *string
ometa.Bool(true)     // *bool
ometa.Int32(42)      // *int32
ometa.Int64(42)      // *int64
ometa.Float64(3.14)  // *float64
ometa.Ptr(myValue)   // *T (generic)

Documentation

Contributing

Issues and pull requests welcome. Build and test targets are in the Makefile; run make help to list them.

License

Apache License 2.0

About

OpenMetadata client SDK. Open Standard for Metadata. A Single place to Discover, Collaborate and Get your data right.

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages