Skip to content

Commit

Permalink
fixup! feat: sqlconnect library
Browse files Browse the repository at this point in the history
  • Loading branch information
atzoum committed Mar 6, 2024
1 parent c8aac4e commit bd7e747
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqlconnect/internal/trino/db.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package trino

import (
"context"
"database/sql"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -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
}

0 comments on commit bd7e747

Please sign in to comment.