📝 Add docstrings to feat/pgsql-driver

Docstrings generation was requested by @scottmckendry.

* https://github.com/tinyauthapp/tinyauth/pull/892#issuecomment-4524261246

The following files were modified:

* `internal/repository/postgres/db.go`
* `internal/repository/postgres/store.go`
This commit is contained in:
coderabbitai[bot]
2026-05-25 17:05:38 +00:00
committed by GitHub
parent 40540ce133
commit f5b9d83360
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -14,7 +14,7 @@ type Store struct {
q *Queries
}
// NewStore wraps a *Queries to satisfy repository.Store.
// NewStore returns a repository.Store backed by the provided *Queries.
func NewStore(q *Queries) repository.Store {
return &Store{q: q}
}
@@ -23,6 +23,8 @@ var errorMap = map[error]error{
sql.ErrNoRows: repository.ErrNotFound,
}
// mapErr maps known database errors to repository-level errors using the package-level errorMap.
// It uses errors.Is to match (so wrapped errors are recognized) and returns the original error if no mapping applies.
func mapErr(err error) error {
for from, to := range errorMap {
if errors.Is(err, from) {