insert-from-python

command
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

Insert from Python

Enqueue a job from Python with the SQL function foreman_insert_job(kind, args, opts) and run it in a Go worker.

docker compose -f deploy/docker-compose.yml up -d --wait postgres  # Postgres on localhost:55432
go run ./examples/insert-from-python                               # safe to rerun

Requires uv. The first run fetches Python 3.12 and psycopg. The script inserts one unique job twice and gets one id back.

Default FOREMAN_DATABASE_URL: postgres://foreman:foreman@localhost:55432/foreman?sslmode=disable.

Expected output

python inserted job 1; unique duplicate returned job 1
go worker sending "welcome" to ada@example.com
job 1 completed

Documentation

Overview

Command insert-from-python runs a Go worker for jobs enqueued by a Python script.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL