Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/modules/awards/pool.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/modules/awards/pool.go |
| Original SHA-256 | f306b41968fb3f1a9c5f02004d083f6a038d2c7d0f7875fce9b2b0d8b6396ada |
| Git blob SHA | 504d325c635b609881f8f9fc826f8f91f0a200fa |
| Reading-copy SHA-256 | f306b41968fb3f1a9c5f02004d083f6a038d2c7d0f7875fce9b2b0d8b6396ada |
Every recorded occurrence
These 2 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/missionmatch / internal/modules/awards/pool.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/modules/awards/pool.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
Recovered source transcript
Download complete source text ↓29 lines · 1.0 KB
package awards
import (
"context"
"github.com/jackc/pgx/v5/pgxpool"
)
// acquirePool resolves the pool to query and a release the caller MUST defer.
//
// These services read GLOBAL reference tables (SAM opportunities, awards, BLS wages) that carry no
// organization_id and no row level security, so they do not need a tenant transaction. They do need a
// pool that actually exists, and under per tenant routing the DB has none of its own: reading s.db.Pool
// directly was a nil dereference that PANICKED the request. Acquire returns the leaf pool for the
// caller's tenant, where these same global tables live because they are part of the shared migration set.
//
// In shared mode this is a no op wrapper over the single pool.
func (s *Service) acquirePool(ctx context.Context) (*pgxpool.Pool, func(), error) {
leaf, release, err := s.db.Acquire(ctx)
if err != nil {
return nil, nil, err
}
if leaf.Pool == nil {
release()
return nil, nil, ErrNoDatabase
}
return leaf.Pool, release, nil
}