Go
Install
Section titled “Install”go get github.com/russellromney/honker-goThe Go binding uses mattn/go-sqlite3, so applications also need the compiled
libhonker_ext.{so,dylib,dll} on disk.
db, err := honker.OpenWithOptions("app.db", "./libhonker_ext.so", honker.OpenOptions{ WatcherBackend: "shm",})if err != nil { log.Fatal(err) }defer db.Close()q := db.Queue("emails", honker.QueueOptions{})_, _ = q.Enqueue(map[string]any{"to": "alice@example.com"}, honker.EnqueueOptions{})
job, _ := q.ClaimOne("worker-1")if job != nil { _, _ = job.Ack()}Transactional Outbox
Section titled “Transactional Outbox”outbox := db.Outbox("email", func(ctx context.Context, payload json.RawMessage) error { return sendEmail(ctx, payload)}, honker.OutboxOptions{})
tx, _ := db.Transaction(ctx)_, _ = tx.Exec("INSERT INTO orders (id, total) VALUES (?, ?)", 42, 9900)_, _ = outbox.EnqueueTx(tx, map[string]any{"order_id": 42}, honker.EnqueueOptions{})_ = tx.Commit()
_ = outbox.RunWorker(ctx, "email-worker")ORM Section
Section titled “ORM Section”For database/sql, use the Honker binding directly or register a sqlite3
driver variant that loads the extension on every connection. For GORM, feed
that driver name into GORM and run Honker SQL from inside db.Transaction.
See the full Go ORM recipe for driver registration and
accessing the raw *sql.Tx in GORM.
Testing
Section titled “Testing”Use exec.Command subprocess workers for watcher-backend proof tests. That
exercises extension loading per process, SQLite reopen behavior, and
cross-process wake delivery.