Files
a2831e2e69 feat: lw13d4 (#30908)
* lw13:d4

* www queues page (#30907)

* new products menu

* set up cron page

* set up cron page

* placeholder sections

* set up queues page

* update meta

* update Supabase Queues landing page content

* Updated the text to exclude queue creation/management from the API management section

* queues www page

---------

Co-authored-by: Wen Bo Xie <wenbo.xie3@gmail.com>
Co-authored-by: Greg Papas <gregpapas@Gregs-MacBook-Pro.local>

* feat: add queue module (#30853)

* feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
docs homepage layout

feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
docs homepage layout

feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
feat: postgres integrations

Create a new global navigation and homepage menu section for the Postgres Integrations category.
reorg: move cron docs into postgres integrations
docs homepage layout

* fix: add pg_cron back to extensions sidebar

* update Supabase Cron docs

* feat: add queues module


feat: add queues module

* remove staging url from screenshots

* remove outdated cron files

* typo

* queues description update

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Wen Bo Xie <wenbo.xie3@gmail.com>
Co-authored-by: Oliver Rice <github@oliverrice.com>

* visibility timeout to window

* queues landing page sql example

* capitalize Dashboard

* cron blog post citus data callout update

* added draft of queues feature

* updated features bulleting

* pluralize queues

* fix Queues features page

* Inital bp

* queues docs updates

* format queues docs

* queues blog post updates

* edits

* Update the images for role in the docs quickstart for queues.

* updated images

* update images

* update more images

* Update 2024-12-05-supabase-queues.mdx

* fix breaks

* punchier title

* better ul

* clean up

* Retake screenshots

* grammar

* whitelines

* video + images

* update docs

* blog updates

* blog update

* api snippet

* api snippet fix

* queues features yt video

* api snippet fix

* update docs

* blog update

* api snippet fix and vale

* format

* vale off

* vale off

* blog update

---------

Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Greg Papas <gregpapas@Gregs-MacBook-Pro.local>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Oliver Rice <github@oliverrice.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-12-05 15:05:47 +00:00

63 lines
2.1 KiB
Plaintext

---
title: API
---
{/* <!-- vale off --> */}
When you create a Queue in Supabase, you can choose to create helper database functions in the `pgmq_public` schema. This schema exposes operations to manage Queue Messages to consumers client-side, but does not expose functions for creating or dropping Queues.
Database functions in `pgmq_public` can be exposed via Supabase Data API so consumers client-side can call them. Visit the [Quickstart](/docs/guides/queues/quickstart) for an example.
## `pgmq_public.pop(queue_name)`
Retrieves the next available message and deletes it from the specified Queue.
- `queue_name` (text): Queue name
---
### `pgmq_public.send(queue_name, message, sleep_seconds)`
Adds a Message to the specified Queue, optionally delaying its visibility to all consumers by a number of seconds.
- `queue_name` (text): Queue name
- `message` (jsonb): Message payload to send
- `sleep_seconds` (integer, optional): Delay message visibility by specified seconds. Defaults to 0
---
### `pgmq_public.send_batch(queue_name, messages, sleep_seconds)`
Adds a batch of Messages to the specified Queue, optionally delaying their availability to all consumers by a number of seconds.
- `queue_name` (text): Queue name
- `messages` (jsonb[]): Array of message payloads to send
- `sleep_seconds` (integer, optional): Delay messages visibility by specified seconds. Defaults to 0
---
### `pgmq_public.archive(queue_name, message_id)`
Archives a Message by moving it from the Queue table to the Queue's archive table.
- `queue_name` (text): Queue name
- `message_id` (bigint): ID of the Message to archive
---
### `pgmq_public.delete(queue_name, message_id)`
Permanently deletes a Message from the specified Queue.
- `queue_name` (text): Queue name
- `message_id` (bigint): ID of the Message to delete
---
### `pgmq_public.read(queue_name, sleep_seconds, n)`
Reads up to "n" Messages from the specified Queue with an optional "sleep_seconds" (visibility timeout).
- `queue_name` (text): Queue name
- `sleep_seconds` (integer): Visibility timeout in seconds
- `n` (integer): Maximum number of Messages to read