Publish to NeonDB¶
When to use¶
Use this flow when HonestRoles artifacts are produced locally and a separate Next.js app must read a stable database contract for agent-facing APIs.
Prerequisites¶
- A Neon/Postgres connection string exported in
NEON_DATABASE_URL. - Cleaned jobs parquet and recommendation index artifacts already built:
honestroles ingest syncorhonestroles runhonestroles recommend build-index- Optional DB dependency installed for CLI usage:
$ pip install -e ".[db]"
Steps¶
- Apply schema migrations:
$ honestroles publish neondb migrate --database-url-env NEON_DATABASE_URL --schema honestroles_api --format table
- Publish latest jobs + features into Neon:
$ honestroles publish neondb sync \
--database-url-env NEON_DATABASE_URL \
--schema honestroles_api \
--jobs-parquet dist/ingest/greenhouse/stripe/jobs.parquet \
--index-dir dist/recommend/index/<index_id> \
--sync-report dist/ingest/greenhouse/stripe/sync_report.json \
--require-quality-pass \
--format table
- Verify DB contract and function health:
$ honestroles publish neondb verify --database-url-env NEON_DATABASE_URL --schema honestroles_api --format table
- Query from Next.js API using SQL function:
SELECT *
FROM honestroles_api.match_jobs_v1(
'{"profile_id":"jane","skills":["python","sql"],"locations":["remote"],"work_mode_preferences":["remote"]}'::jsonb,
25,
false,
'{}'::jsonb
);
Expected result¶
migratereports latest migration applied inhonestroles_api.migration_history.syncwrites/upsertsjobs_live,job_features,job_facets, and updatespublish_batches.verifyreturnspasswith all required tables/functions present.- Next.js API can execute
match_jobs_v1(...)without invoking Python at request time.
Next steps¶
- Wire the Next.js API route to call
honestroles_api.match_jobs_v1(...). - Schedule periodic
publish neondb syncafter ingestion/index refreshes. - Add
publish neondb verifyto deployment checks before API rollouts.
Manual CI Smoke¶
Use the manual GitHub Actions workflow NeonDB Smoke for end-to-end contract validation:
- Configure repository secret
NEON_DATABASE_URL. - Trigger workflow
NeonDB Smoke(default schemahonestroles_api). - The workflow runs:
publish neondb migratepublish neondb sync(sample artifacts generated in workflow)publish neondb verify- a live
match_jobs_v1(...)query with contract-key assertions.