Skip to content

Navigation Menu

Sign in
Sign up

Insert Jobs From SQL? #1006

Unanswered
thezachdrake asked this question in Q&A
Discussion options

Is there way to insert jobs with raw SQL from any language? The docs only mention the Python and Ruby libraries. It would be awesome to let any service in any language insert jobs with SQL and then let the Go engine work them.

You must be logged in to vote

Replies: 3 comments

Comment options

Good point, it's pretty plausible to insert jobs via any SQL with something like this:

INSERT INTO river_job (
 kind,
 args,
 max_attempts
) values (
 'fake_job',
 '{}',
 25
);
SELECT pg_notify(current_schema() || '.river_insert', '{"queue":"default"}');

That's the core set of fields without defaults on the columns, but you can of course do additional customization on properties like priority, queue, metadata, tags, etc.

Note though that the unique logic is quite complicated, so unique jobs won't be usable without a fairly well-vetted client library.

You must be logged in to vote
0 replies
Comment options

This is helpful thank you!

You must be logged in to vote
0 replies
Comment options

We added some formal docs on this here:

https://riverqueue.com/docs/sql

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #1005 on August 11, 2025 05:39.

AltStyle によって変換されたページ (->オリジナル) /