mirror of
https://github.com/ForFarmTeam/ForFarm.git
synced 2025-12-18 13:34:08 +01:00
23 lines
724 B
Go
23 lines
724 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5"
|
|
"github.com/jackc/pgx/v5/pgconn"
|
|
)
|
|
|
|
// Connection represents a simplified interface for database operations.
|
|
type Connection interface {
|
|
Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
|
|
Query(context.Context, string, ...interface{}) (pgx.Rows, error)
|
|
QueryRow(context.Context, string, ...interface{}) pgx.Row
|
|
}
|
|
|
|
// placeholderSpanWithQuery is a dummy function for tracking queries.
|
|
// It serves as a placeholder and currently only returns the given context.
|
|
func placeholderSpanWithQuery(ctx context.Context, query string) context.Context {
|
|
// In a real implementation, you might log the query or attach metrics.
|
|
return ctx
|
|
}
|