Metabase is an analytics tool which allows anyone to easily learn and make decisions from their company's data. It allows you to query data directly from your databases (called "questions"), which you can store and share with others, as well as generate reports.
This module provides an SDK to interact with the Metabase API for the Go programming language.
Note
This SDK is not officially maintained or endorsed by Metabase.
-
Add the SDK to your project using
go get
go get github.com:bnjns/metabase-sdk-go
-
Create an authenticator, to tell the client how to authenticate with the API
package main import "github.com/bnjns/metabase-sdk-go/metabase" func main() { // Both session-based and API key-based authentication is supported authenticator, err := metabase.NewApiKeyAuthenticator("<api key>") if err != nil { panic(err) } }
-
Create the client
func main() { // ... client, err := metabase.NewClient("<host>", authenticator) if err != nil { panic(err) } }
See the docs for more details.
- Go >= 1.22
- Docker and Docker Compose
- Task
- golangci-lint
If you wish to update the documentation, you will also need:
- Python 3.12
- Material for Mkdocs
To get started, simply clone the repository:
git clone git@github.com:bnjns/metabase-sdk-go.git
Then install the Go dependencies:
go mod download
Use Task to run and set up Metabase using Docker:
task run:metabase
task setup:metabase
go test -v ./...
or, using Task:
task check:test
task check:lint