Tip
If you already have a Trino instance running, skip the steps to run Trino in a Docker container.
-
Start Trino in a Docker container:
docker run -d --name trino -p 8080:8080 trinodb/trino
-
Install the Trino ADBC driver:
dbc install trino
-
Customize the Go program
main.goas needed- Change the connection arguments in the
NewDatabase()call- Format
uriaccording to the DSN (Data Source Name) format used by the Trino Go client, or keep it as is to use the TPC-H data included in the Trino Docker container image
- Format
- If you changed which Trino instance you're connecting to, also change the SQL SELECT statement in
stmt.SetSqlQuery()
- Change the connection arguments in the
-
Run the Go program:
go mod tidy go run main.go
-
Stop and remove the Docker container running Trino:
docker stop trino docker rm trino