Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | internal/platform/database/dbgen/wages.sql.go |
| Original SHA-256 | 9b1da9b260b39e199bae6f01d7030cf6ec6474505692d4c549e8e77e9a53ba15 |
| Git blob SHA | 3ec85dff42db2eadf6595699481b955a7f9edf7f |
| Reading-copy SHA-256 | 9b1da9b260b39e199bae6f01d7030cf6ec6474505692d4c549e8e77e9a53ba15 |
Every recorded occurrence
These 11 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/platform/database/dbgen/wages.sql.go | feature/opportunity-to-outcome | 720d47fae476b0d38477ae4401697d372b1ea2bc | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | collision-deconfliction | 4ee5a09972608ed89f8377c6665542d5f450f0a6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | m5-price-to-win | 41000ad30fff4129fdaf5ec84e15ba14c27d4890 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | master | 1e9249840a4302ec82e123b9c9cb6f75badea3e4 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | mag-substrate | b82c7100a492dec67dfd1eda6b3f53def859be35 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | time-to-fill-survival | b66e1e505863d4f17741a4b9ede73509e45bd6c6 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | presentation-readiness | eb574acaa29d71ce4d0f852572e87c275c79fdb7 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | vendor-intelligence | fe9796a19c261951d3f2565206c0c1b5ac294465 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | phase2-connectors | e038d4c687aec16f8bd9bc4d907eea14d91f8704 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | feature/aioe-upgrade | 2178e7298d0e5d9af83afa12402fd587f0ba6ed8 | Open original |
| Janady13/missionmatch / internal/platform/database/dbgen/wages.sql.go | capture-readiness | bae6af7cb2997e819174a9e9cfff5e16067a1975 | Open original |
Recovered source transcript
Download complete source text ↓165 lines · 4.9 KB
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
// source: wages.sql
package dbgen
import (
"context"
"github.com/shopspring/decimal"
)
const listBlsWages = `-- name: ListBlsWages :many
SELECT series_id, occupation_code, occupation_title, role, area, area_name, metric, period_year, value, raw, synced_at FROM bls_wages ORDER BY occupation_code, area, metric
`
func (q *Queries) ListBlsWages(ctx context.Context) ([]BlsWage, error) {
rows, err := q.db.Query(ctx, listBlsWages)
if err != nil {
return nil, err
}
defer rows.Close()
items := []BlsWage{}
for rows.Next() {
var i BlsWage
if err := rows.Scan(
&i.SeriesID,
&i.OccupationCode,
&i.OccupationTitle,
&i.Role,
&i.Area,
&i.AreaName,
&i.Metric,
&i.PeriodYear,
&i.Value,
&i.Raw,
&i.SyncedAt,
); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const upsertBlsWage = `-- name: UpsertBlsWage :exec
INSERT INTO bls_wages (
series_id, occupation_code, occupation_title, role, area, area_name, metric, period_year, value, raw, synced_at
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, now()
)
ON CONFLICT (series_id) DO UPDATE SET
occupation_code = EXCLUDED.occupation_code,
occupation_title = EXCLUDED.occupation_title,
role = EXCLUDED.role,
area = EXCLUDED.area,
area_name = EXCLUDED.area_name,
metric = EXCLUDED.metric,
period_year = EXCLUDED.period_year,
value = EXCLUDED.value,
raw = EXCLUDED.raw,
synced_at = now()
`
type UpsertBlsWageParams struct {
SeriesID string `json:"series_id"`
OccupationCode string `json:"occupation_code"`
OccupationTitle string `json:"occupation_title"`
Role string `json:"role"`
Area string `json:"area"`
AreaName string `json:"area_name"`
Metric string `json:"metric"`
PeriodYear string `json:"period_year"`
Value *decimal.Decimal `json:"value"`
Raw []byte `json:"raw"`
}
// BLS OEWS wage baseline cache. Global public catalog (no organization_id, outside RLS): reads run
// off the pool, writes come from the weekly rates sync (cmd/rates-sync) as the migrator role.
func (q *Queries) UpsertBlsWage(ctx context.Context, arg UpsertBlsWageParams) error {
_, err := q.db.Exec(ctx, upsertBlsWage,
arg.SeriesID,
arg.OccupationCode,
arg.OccupationTitle,
arg.Role,
arg.Area,
arg.AreaName,
arg.Metric,
arg.PeriodYear,
arg.Value,
arg.Raw,
)
return err
}
const upsertBlsWageByOcc = `-- name: UpsertBlsWageByOcc :exec
INSERT INTO bls_wages (
series_id, occupation_code, occupation_title, role, area, area_name, metric, period_year, value, raw, synced_at
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, now()
)
ON CONFLICT (occupation_code, area, metric) DO UPDATE SET
series_id = EXCLUDED.series_id,
occupation_title = EXCLUDED.occupation_title,
role = EXCLUDED.role,
area_name = EXCLUDED.area_name,
period_year = EXCLUDED.period_year,
value = EXCLUDED.value,
raw = EXCLUDED.raw,
synced_at = now()
`
type UpsertBlsWageByOccParams struct {
SeriesID string `json:"series_id"`
OccupationCode string `json:"occupation_code"`
OccupationTitle string `json:"occupation_title"`
Role string `json:"role"`
Area string `json:"area"`
AreaName string `json:"area_name"`
Metric string `json:"metric"`
PeriodYear string `json:"period_year"`
Value *decimal.Decimal `json:"value"`
Raw []byte `json:"raw"`
}
// National OEWS wage expansion upsert, keyed on the natural key (occupation_code, area, metric), the
// UNIQUE added in migration 0035. Used by cmd/oews-national-sync for the area='US' national rows: a
// second run updates the value in place and inserts nothing new. Idempotent.
func (q *Queries) UpsertBlsWageByOcc(ctx context.Context, arg UpsertBlsWageByOccParams) error {
_, err := q.db.Exec(ctx, upsertBlsWageByOcc,
arg.SeriesID,
arg.OccupationCode,
arg.OccupationTitle,
arg.Role,
arg.Area,
arg.AreaName,
arg.Metric,
arg.PeriodYear,
arg.Value,
arg.Raw,
)
return err
}
const wagesSyncMeta = `-- name: WagesSyncMeta :one
SELECT COUNT(*)::bigint AS total, MAX(synced_at) AS last_synced FROM bls_wages
`
type WagesSyncMetaRow struct {
Total int64 `json:"total"`
LastSynced interface{} `json:"last_synced"`
}
func (q *Queries) WagesSyncMeta(ctx context.Context) (WagesSyncMetaRow, error) {
row := q.db.QueryRow(ctx, wagesSyncMeta)
var i WagesSyncMetaRow
err := row.Scan(&i.Total, &i.LastSynced)
return i, err
}