From bd7e7471b9bc319b5c5024183c73fdf6eb22d754 Mon Sep 17 00:00:00 2001 From: Aris Tzoumas Date: Wed, 6 Mar 2024 15:01:10 +0200 Subject: [PATCH] fixup! feat: sqlconnect library --- sqlconnect/internal/trino/db.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sqlconnect/internal/trino/db.go b/sqlconnect/internal/trino/db.go index 0fbdd9d..3db24ee 100644 --- a/sqlconnect/internal/trino/db.go +++ b/sqlconnect/internal/trino/db.go @@ -1,6 +1,7 @@ package trino import ( + "context" "database/sql" "encoding/json" "fmt" @@ -72,3 +73,12 @@ func init() { type DB struct { *base.DB } + +func (db *DB) Ping() error { + return db.PingContext(context.Background()) +} + +func (db *DB) PingContext(ctx context.Context) error { + _, err := db.ExecContext(ctx, "select 1") + return err +}