Skip to content

how to use with graphile-worker #178

@ssendev

Description

@ssendev

Summary

I am using graphile-worker and am unsure how to mesh them together

// .gmrc.js
{
  afterReset: [
    {
      _: 'command',
      command:
        'DATABASE_URL="$OWNER_DATABASE_URL" npx --no-install graphile-worker --schema-only',
      shadow: false,
    },
    {
      _: 'command',
      command:
        'DATABASE_URL="$SHADOW_DATABASE_URL" npx --no-install graphile-worker --schema-only',
      shadow: true,
    },
  ],
  ...
}

seems to get the job done but is this future proof or is there a better way?

If for example i have the following migration

create or replace function app_private.add_job(identifier text, payload json DEFAULT NULL::json, queue_name text DEFAULT NULL::text, run_at timestamp with time zone DEFAULT NULL::timestamp with time zone, max_attempts integer DEFAULT NULL::integer, job_key text DEFAULT NULL::text, priority integer DEFAULT NULL::integer, flags text[] DEFAULT NULL::text[], job_key_mode text DEFAULT 'replace'::text) RETURNS graphile_worker.jobs as $$
  select graphile_worker.add_job(identifier, payload, queue_name, run_at, max_attempts, job_key, priority , flags, job_key_mode);
$$ language sql security definer;

and in the future graphile-worker changes add_job or jobs would the migration fail? is there a way around it?

Either way mentioning the way to integrate with graphile-worker in the readme would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions