summaryrefslogtreecommitdiff
path: root/golang/pkg/database/db.go
blob: 3e07db31f47b9b9210e9b06facac3773ef814db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package database

import (
	"context"
	"database/sql"
)

type DB struct {
	ctx context.Context
	db  *sql.DB
}

func (db *DB) Exec(query string, args ...any) (sql.Result, error) {
	return db.db.ExecContext(db.ctx, query, args...)
}

func (db *DB) QueryRow(query string, args ...any) *sql.Row {
	return db.db.QueryRowContext(db.ctx, query, args...)
}