-
Notifications
You must be signed in to change notification settings - Fork 178
Insert Jobs From SQL? #1006
Unanswered
thezachdrake
asked this question in
Q&A
Insert Jobs From SQL?
#1006
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.
All reactions
Replies: 3 comments
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.
All reactions
0 replies
This is helpful thank you!
All reactions
-
👍 1
0 replies
We added some formal docs on this here:
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment