Help us shape the future of Go! Take the 2026 Go Developer Survey

openmetadata-ingestion-go

module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT

README

openmetadata-ingestion-go

A small, single-binary metadata ingestion tool for OpenMetadata, written in Go. It connects to a relational database, extracts its schema metadata, and pushes it to an OpenMetadata server via the official Go SDK.

It is a focused Go alternative to a subset of the Python openmetadata-ingestion package, intended for pushing database metadata from servers without a Python runtime. It deliberately reuses the same workflow YAML format as the Python connectors, so existing configs work unchanged.

Supported sources

Source Connection type Extracted
PostgreSQL PostgreSQL databases, schemas, tables, views, columns, PKs
MySQL Mysql schemas, tables, views, columns, PKs
ClickHouse Clickhouse databases (as schemas), tables, views, columns, PKs

For every source the tool also extracts table/column descriptions (comments) and applies include/exclude regex filtering for schemas and tables.

Entities pushed

DatabaseService → Database → DatabaseSchema → Table (with Columns, primary-key constraints, and table/view classification). Every write uses CreateOrUpdate, so re-running an ingestion is idempotent.

Install / build

Requires Go 1.24+.

go build -o omingest ./cmd/omingest

Usage

# Push metadata
omingest ingest -c workflow.yaml

# Just check the source DB is reachable
omingest test-connection -c workflow.yaml

# Override the configured log level
omingest ingest -c workflow.yaml --log-level DEBUG
Configuration

The config is compatible with the Python ingestion workflow YAML. See testdata/workflow.postgres.yaml for a complete example:

source:
  type: postgres
  serviceName: local_postgres
  serviceConnection:
    config:
      type: PostgreSQL
      username: postgres
      authType:
        password: postgres
      hostPort: localhost:5432
      database: postgres
      ingestAllDatabases: false
      sslMode: disable
  sourceConfig:
    config:
      type: DatabaseMetadata
      includeTables: true
      includeViews: true
      schemaFilterPattern:
        includes: [public]
        excludes: ["^pg_"]
      tableFilterPattern:
        excludes: ["_tmp$"]
sink:
  type: metadata-rest
  config: {}
workflowConfig:
  loggerLevel: INFO
  openMetadataServerConfig:
    hostPort: "http://localhost:8585/api"
    authProvider: openmetadata
    securityConfig:
      jwtToken: "<bot-jwt-token>"

Unknown YAML keys (Python options this tool does not implement) are ignored, not rejected.

Filter precedence matches the Python connectors: an exclude match rejects immediately; if there are no includes, everything else is allowed; otherwise a name must match an include. Patterns are unanchored regular expressions (re.search semantics).

Secrets

The DB password and the OpenMetadata JWT are read from the config and are never logged. Keep your workflow YAML out of version control, or template the secret values in from your secret manager at deploy time.

Notes / not yet implemented

  • markDeletedTables is parsed but not yet acted upon (no soft-delete of entities that disappear between runs).
  • No profiler, sample data, lineage, or query-usage ingestion.
  • MySQL and ClickHouse have a single namespace level; each is mapped to an OpenMetadata DatabaseSchema under a single logical Database named default.

Development

go test ./...      # unit tests (no DB or network required)
go vet ./...

Directories

Path Synopsis
cmd
metadata command
Command metadata pushes database metadata to an OpenMetadata server, driven by a Python-compatible ingestion workflow YAML.
Command metadata pushes database metadata to an OpenMetadata server, driven by a Python-compatible ingestion workflow YAML.
omingest command
Command omingest pushes database metadata to an OpenMetadata server, driven by a Python-compatible ingestion workflow YAML.
Command omingest pushes database metadata to an OpenMetadata server, driven by a Python-compatible ingestion workflow YAML.
internal
cli
Package cli implements the `metadata` command line interface.
Package cli implements the `metadata` command line interface.
config
Package config unmarshals the OpenMetadata ingestion workflow YAML.
Package config unmarshals the OpenMetadata ingestion workflow YAML.
filter
Package filter implements include/exclude regex filtering for schema and table names, matching the semantics of the Python openmetadata-ingestion connectors.
Package filter implements include/exclude regex filtering for schema and table names, matching the semantics of the Python openmetadata-ingestion connectors.
fqn
Package fqn builds OpenMetadata fully-qualified names.
Package fqn builds OpenMetadata fully-qualified names.
logging
Package logging configures the process-wide slog logger from the workflow's loggerLevel, with an optional CLI override.
Package logging configures the process-wide slog logger from the workflow's loggerLevel, with an optional CLI override.
model
Package model defines a source-neutral representation of the database metadata hierarchy.
Package model defines a source-neutral representation of the database metadata hierarchy.
sink
Package sink defines where extracted metadata is written.
Package sink defines where extracted metadata is written.
source
Package source defines the Source abstraction and a registry of source implementations keyed by connection type.
Package source defines the Source abstraction and a registry of source implementations keyed by connection type.
source/clickhouse
Package clickhouse extracts schema metadata from a ClickHouse service.
Package clickhouse extracts schema metadata from a ClickHouse service.
source/mysql
Package mysql extracts schema metadata from a MySQL service.
Package mysql extracts schema metadata from a MySQL service.
source/postgres
Package postgres extracts schema metadata from a PostgreSQL service.
Package postgres extracts schema metadata from a PostgreSQL service.
typemap
Package typemap normalises native database column type strings into the OpenMetadata ColumnDataType enum, preserving the original string for display and extracting length/precision/scale where present.
Package typemap normalises native database column type strings into the OpenMetadata ColumnDataType enum, preserving the original string for display and extracting length/precision/scale where present.
workflow
Package workflow wires a Source to a Sink and drives the metadata push in the order required by OpenMetadata's entity hierarchy: service, then databases, then schemas, then tables.
Package workflow wires a Source to a Sink and drives the metadata push in the order required by OpenMetadata's entity hierarchy: service, then databases, then schemas, then tables.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL