Skip to main content

Overview

The Collate Go SDK provides a type-safe, auto-generated client library for Go applications to interact with the Collate API. Built from OpenAPI specifications, it offers strongly typed services for 60+ entity types with automatic pagination, retry logic, and comprehensive error handling. You can find the source code in the GitHub repository. As an open-source project, contributions are always welcome!

Requirements

  • Go 1.24 or higher

Installation

Quick Start

Basic Connection

Client Configuration Options

Retryable status codes are 429 (Too Many Requests) and 504 (Gateway Timeout).

Core Functionality

Available Services

The client exposes typed services for all entity types. Here are the most commonly used: Data Assets: Tables, Topics, Dashboards, Pipelines, Charts, Containers, SearchIndexes, StoredProcedures, Queries Data Organization: Databases, DatabaseSchemas, APICollections, APIEndpoints Governance: Glossaries, GlossaryTerms, Classifications, Tags, DataProducts, Domains, Policies Quality: TestCases, TestSuites, TestDefinitions Services: DatabaseServices, DashboardServices, PipelineServices, MessagingServices, SearchServices, StorageServices People & Access: Users, Teams, Roles, Bots Other: IngestionPipelines, EventSubscriptions, MlModels

Standard Operations

All services follow the same consistent pattern with these methods:

List

Returns a Go iterator (iter.Seq2) that handles pagination automatically.

GetByID

Retrieve an entity by UUID.

GetByName

Retrieve an entity by fully qualified name (FQN).

Create

Create a new entity.

CreateOrUpdate

Upsert an entity - creates if it doesn’t exist, updates if it does.

Patch

Apply JSON Patch operations (RFC 6902) to update specific fields.

Delete / DeleteByName

Delete an entity by ID or fully qualified name. Supports soft and hard deletes.

Restore

Restore a soft-deleted entity.

ListVersions / GetVersion

Access entity version history.

Pointer Helpers

Since many fields are optional (pointers), the SDK provides helper functions:

Error Handling

The APIError type provides:
  • StatusCode - HTTP status code
  • Code - API error code
  • Message - Error message

Common Use Cases

Create a Database Service, Database, Schema, and Table

Iterate Over All Tables

Update Metadata with Patch

Soft Delete and Restore

Context with Timeout

Best Practices

  1. Use context timeouts: Always set appropriate timeouts for API calls to avoid hanging requests
  2. Handle pagination with iterators: Use range with List methods - the SDK handles cursor-based pagination automatically
  3. Prefer GetByName over GetByID: Fully qualified names are more readable and easier to manage
  4. Use Patch for partial updates: Prefer Patch over CreateOrUpdate when updating specific fields to avoid overwriting other data
  5. Check errors with helpers: Use ometa.IsNotFound() and ometa.IsConflict() for common error handling patterns
  6. Soft delete first: Use soft deletes in production and reserve hard deletes for cleanup operations