# README
Metabase SDK Go
An SDK for interacting with the Metabase REST API for the Go programming language.
🧐 About
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.
🎈 Usage
-
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.
🔧 Contributing
Prerequisites
- 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
Install
To get started, simply clone the repository:
git clone [email protected]:bnjns/metabase-sdk-go.git
Then install the Go dependencies:
go mod download
Running Metabase
Use Task to run and set up Metabase using Docker:
task run:metabase
task setup:metabase
Running tests
go test -v ./...
or, using Task:
task check:test
Linting
task check:lint