ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.go
DateNot specified in source
RepositoryJanady13/missionmatch
Revision09015496d565a172bcaa15cfe9a8e4b072b13df0
Branchworkstream-b-screenmatch
Path or archive memberinternal/platform/database/dbgen/opportunity_records.sql.go
Original SHA-2564517cef9d2395f6ee067a67b2ef1645c3785197b1749ba395652d673014aabf1
Git blob SHAbbf587d07ab539a726e903b5c0713135cb70c7f2
Reading-copy SHA-2564517cef9d2395f6ee067a67b2ef1645c3785197b1749ba395652d673014aabf1

Original source ↗

Every recorded occurrence

These 39 records contain identical original source bytes. Their paths and revisions remain part of the archive.

Original recordBranch or archiveRevision / identifierOriginal location
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-b-screenmatch09015496d565a172bcaa15cfe9a8e4b072b13df0Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-a-opportunity-intelligence1675031db74316e100782d063e9eda1a597fe3a1Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-d-command-center255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-d-missionmatch3be46ba89edb737182075a2b320509b42dc916f8Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-e-dataflow-deploy433815a042f9741411e60fa553fe72143e9b10dbOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gow3-ai-staffing-recommendations43d56387270ef4da4cabd794d97ca6a49909bc7dOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-e-commercial-stubs4437da660539284a400ee380b9b427a300c369eeOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows3-clearance4b8e7ce594c068621867f9c9deed0ec64ae6c553Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-c-slatematch5cd60c918301b46ecd6ed3e03e20c395da0062e2Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goai-intelligence-layer5d5ddff70393a197c5f54a45280bb5dd42b24755Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows6-retrieval6c56e29231ec05735927fa265c97d517499dfeafOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goper-tenant-routing9bde0f9a74b89d01980fa658e5253acda7528d0cOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goai-brain-liveaac32fc49c878cc5bca099459307611562d0bac1Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows1-ontology-syncb596f449a32a1016fbd403c36505cc00a1ac9ee6Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goruthless-debug-sweepb7d742f8f032984be3817efffa3eb8b13b651c1fOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.godeploy-and-opsbdacd9d0b4d5998d25fc74bf4007f4c3ec538c7aOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gophase2-eval-fairnessd361af254701975fe239927656ababb56374655eOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-b-sam-contract-awardsd5101cceb98e70000cebb31d3e7ac73d747d3a6dOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-a-shared-coree0de03ac3a1ec826bd15d0e048e3b02baa23eeffOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows2-alias-relationshipe4dada4601c6eb101830f9d223a9655dfa120616Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goper-tenant-routing9bde0f9a74b89d01980fa658e5253acda7528d0cOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows6-retrieval6c56e29231ec05735927fa265c97d517499dfeafOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-a-shared-coree0de03ac3a1ec826bd15d0e048e3b02baa23eeffOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-c-slatematch5cd60c918301b46ecd6ed3e03e20c395da0062e2Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows1-ontology-syncb596f449a32a1016fbd403c36505cc00a1ac9ee6Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gow3-ai-staffing-recommendations43d56387270ef4da4cabd794d97ca6a49909bc7dOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gows3-clearance4b8e7ce594c068621867f9c9deed0ec64ae6c553Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-d-command-center255e7d1d420abf5e277d0cd8c9b14f6f72b6acb9Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.gophase2-eval-fairnessd361af254701975fe239927656ababb56374655eOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-e-dataflow-deploy433815a042f9741411e60fa553fe72143e9b10dbOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goruthless-debug-sweepb7d742f8f032984be3817efffa3eb8b13b651c1fOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goai-intelligence-layer5d5ddff70393a197c5f54a45280bb5dd42b24755Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-a-opportunity-intelligence1675031db74316e100782d063e9eda1a597fe3a1Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.godeploy-and-opsbdacd9d0b4d5998d25fc74bf4007f4c3ec538c7aOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-b-screenmatch09015496d565a172bcaa15cfe9a8e4b072b13df0Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-e-commercial-stubs4437da660539284a400ee380b9b427a300c369eeOpen original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goai-brain-liveaac32fc49c878cc5bca099459307611562d0bac1Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-d-missionmatch3be46ba89edb737182075a2b320509b42dc916f8Open original
Janady13/missionmatch / internal/platform/database/dbgen/opportunity_records.sql.goworkstream-b-sam-contract-awardsd5101cceb98e70000cebb31d3e7ac73d747d3a6dOpen original

Recovered source transcript

// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.31.1 // source: opportunity_records.sql package dbgen import ( "context" "time" "github.com/google/uuid" "github.com/jackc/pgx/v5/pgtype" "github.com/shopspring/decimal" ) const getOpportunityRecord = `-- name: GetOpportunityRecord :one SELECT id, source_name, source_record_id, dedupe_key, record_kind, title, agency, sub_agency, naics, psc, pop_city, pop_state, pop_country, pop_zip, set_aside, set_aside_code, contract_vehicle, estimated_value, value_source, incumbent_name, incumbent_uei, posted_date, response_deadline, award_date, estimated_award_date, pop_start_date, pop_end_date, ui_link, is_planning, raw_object_key, raw_sha256, fetched_at, synced_at FROM opportunity_records WHERE id = $1 ` func (q *Queries) GetOpportunityRecord(ctx context.Context, id uuid.UUID) (OpportunityRecord, error) { row := q.db.QueryRow(ctx, getOpportunityRecord, id) var i OpportunityRecord err := row.Scan( &i.ID, &i.SourceName, &i.SourceRecordID, &i.DedupeKey, &i.RecordKind, &i.Title, &i.Agency, &i.SubAgency, &i.Naics, &i.Psc, &i.PopCity, &i.PopState, &i.PopCountry, &i.PopZip, &i.SetAside, &i.SetAsideCode, &i.ContractVehicle, &i.EstimatedValue, &i.ValueSource, &i.IncumbentName, &i.IncumbentUei, &i.PostedDate, &i.ResponseDeadline, &i.AwardDate, &i.EstimatedAwardDate, &i.PopStartDate, &i.PopEndDate, &i.UiLink, &i.IsPlanning, &i.RawObjectKey, &i.RawSha256, &i.FetchedAt, &i.SyncedAt, ) return i, err } const listOpportunityRecords = `-- name: ListOpportunityRecords :many SELECT id, source_name, source_record_id, dedupe_key, record_kind, title, agency, sub_agency, naics, psc, pop_city, pop_state, pop_country, pop_zip, set_aside, set_aside_code, contract_vehicle, estimated_value, value_source, incumbent_name, incumbent_uei, posted_date, response_deadline, award_date, estimated_award_date, pop_start_date, pop_end_date, ui_link, is_planning, raw_object_key, raw_sha256, fetched_at, synced_at FROM opportunity_records WHERE ($1::text[] IS NULL OR record_kind = ANY($1::text[])) AND ($2::text[] IS NULL OR naics = ANY($2::text[])) AND ($3::text[] IS NULL OR upper(agency) = ANY($3::text[])) AND ($4::text[] IS NULL OR upper(pop_state) = ANY($4::text[])) ORDER BY (response_deadline IS NULL OR response_deadline < now()), response_deadline ASC, posted_date DESC NULLS LAST, id LIMIT $5::int ` type ListOpportunityRecordsParams struct { Kinds []string `json:"kinds"` Naics []string `json:"naics"` Agencies []string `json:"agencies"` States []string `json:"states"` Lim int32 `json:"lim"` } // Optional filters (NULL array = no filter). Soonest closing first, then most recently posted, then id // as a unique tiebreaker so the order is deterministic. Text equality filters compare upper() on both // sides; the service upper cases the params so casing drift cannot silently zero out results. func (q *Queries) ListOpportunityRecords(ctx context.Context, arg ListOpportunityRecordsParams) ([]OpportunityRecord, error) { rows, err := q.db.Query(ctx, listOpportunityRecords, arg.Kinds, arg.Naics, arg.Agencies, arg.States, arg.Lim, ) if err != nil { return nil, err } defer rows.Close() items := []OpportunityRecord{} for rows.Next() { var i OpportunityRecord if err := rows.Scan( &i.ID, &i.SourceName, &i.SourceRecordID, &i.DedupeKey, &i.RecordKind, &i.Title, &i.Agency, &i.SubAgency, &i.Naics, &i.Psc, &i.PopCity, &i.PopState, &i.PopCountry, &i.PopZip, &i.SetAside, &i.SetAsideCode, &i.ContractVehicle, &i.EstimatedValue, &i.ValueSource, &i.IncumbentName, &i.IncumbentUei, &i.PostedDate, &i.ResponseDeadline, &i.AwardDate, &i.EstimatedAwardDate, &i.PopStartDate, &i.PopEndDate, &i.UiLink, &i.IsPlanning, &i.RawObjectKey, &i.RawSha256, &i.FetchedAt, &i.SyncedAt, ); err != nil { return nil, err } items = append(items, i) } if err := rows.Err(); err != nil { return nil, err } return items, nil } const opportunityRecordMeta = `-- name: OpportunityRecordMeta :one SELECT COUNT(*)::bigint AS total, MAX(synced_at) AS last_synced FROM opportunity_records ` type OpportunityRecordMetaRow struct { Total int64 `json:"total"` LastSynced interface{} `json:"last_synced"` } func (q *Queries) OpportunityRecordMeta(ctx context.Context) (OpportunityRecordMetaRow, error) { row := q.db.QueryRow(ctx, opportunityRecordMeta) var i OpportunityRecordMetaRow err := row.Scan(&i.Total, &i.LastSynced) return i, err } const upsertOpportunityRecord = `-- name: UpsertOpportunityRecord :exec INSERT INTO opportunity_records ( source_name, source_record_id, dedupe_key, record_kind, title, agency, sub_agency, naics, psc, pop_city, pop_state, pop_country, pop_zip, set_aside, set_aside_code, contract_vehicle, estimated_value, value_source, incumbent_name, incumbent_uei, posted_date, response_deadline, award_date, estimated_award_date, pop_start_date, pop_end_date, ui_link, is_planning, raw_object_key, raw_sha256, fetched_at, synced_at ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, now() ) ON CONFLICT (source_name, source_record_id) DO UPDATE SET dedupe_key = EXCLUDED.dedupe_key, record_kind = EXCLUDED.record_kind, title = EXCLUDED.title, agency = EXCLUDED.agency, sub_agency = EXCLUDED.sub_agency, naics = EXCLUDED.naics, psc = EXCLUDED.psc, pop_city = EXCLUDED.pop_city, pop_state = EXCLUDED.pop_state, pop_country = EXCLUDED.pop_country, pop_zip = EXCLUDED.pop_zip, set_aside = EXCLUDED.set_aside, set_aside_code = EXCLUDED.set_aside_code, contract_vehicle = EXCLUDED.contract_vehicle, estimated_value = EXCLUDED.estimated_value, value_source = EXCLUDED.value_source, incumbent_name = EXCLUDED.incumbent_name, incumbent_uei = EXCLUDED.incumbent_uei, posted_date = EXCLUDED.posted_date, response_deadline = EXCLUDED.response_deadline, award_date = EXCLUDED.award_date, estimated_award_date = EXCLUDED.estimated_award_date, pop_start_date = EXCLUDED.pop_start_date, pop_end_date = EXCLUDED.pop_end_date, ui_link = EXCLUDED.ui_link, is_planning = EXCLUDED.is_planning, raw_object_key = EXCLUDED.raw_object_key, raw_sha256 = EXCLUDED.raw_sha256, fetched_at = EXCLUDED.fetched_at, synced_at = now() ` type UpsertOpportunityRecordParams struct { SourceName string `json:"source_name"` SourceRecordID string `json:"source_record_id"` DedupeKey string `json:"dedupe_key"` RecordKind string `json:"record_kind"` Title string `json:"title"` Agency string `json:"agency"` SubAgency string `json:"sub_agency"` Naics string `json:"naics"` Psc string `json:"psc"` PopCity string `json:"pop_city"` PopState string `json:"pop_state"` PopCountry string `json:"pop_country"` PopZip string `json:"pop_zip"` SetAside string `json:"set_aside"` SetAsideCode string `json:"set_aside_code"` ContractVehicle string `json:"contract_vehicle"` EstimatedValue *decimal.Decimal `json:"estimated_value"` ValueSource string `json:"value_source"` IncumbentName string `json:"incumbent_name"` IncumbentUei string `json:"incumbent_uei"` PostedDate pgtype.Date `json:"posted_date"` ResponseDeadline *time.Time `json:"response_deadline"` AwardDate pgtype.Date `json:"award_date"` EstimatedAwardDate pgtype.Date `json:"estimated_award_date"` PopStartDate pgtype.Date `json:"pop_start_date"` PopEndDate pgtype.Date `json:"pop_end_date"` UiLink string `json:"ui_link"` IsPlanning bool `json:"is_planning"` RawObjectKey string `json:"raw_object_key"` RawSha256 string `json:"raw_sha256"` FetchedAt time.Time `json:"fetched_at"` } // Opportunity Intelligence unified records. Global public catalog (no organization_id, outside RLS): // reads run straight off the pool, writes come from cmd/opp-sync as the migrator role. func (q *Queries) UpsertOpportunityRecord(ctx context.Context, arg UpsertOpportunityRecordParams) error { _, err := q.db.Exec(ctx, upsertOpportunityRecord, arg.SourceName, arg.SourceRecordID, arg.DedupeKey, arg.RecordKind, arg.Title, arg.Agency, arg.SubAgency, arg.Naics, arg.Psc, arg.PopCity, arg.PopState, arg.PopCountry, arg.PopZip, arg.SetAside, arg.SetAsideCode, arg.ContractVehicle, arg.EstimatedValue, arg.ValueSource, arg.IncumbentName, arg.IncumbentUei, arg.PostedDate, arg.ResponseDeadline, arg.AwardDate, arg.EstimatedAwardDate, arg.PopStartDate, arg.PopEndDate, arg.UiLink, arg.IsPlanning, arg.RawObjectKey, arg.RawSha256, arg.FetchedAt, ) return err }

Search equations, builds, manuscript text, and recovered sources.