-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PGXN requires a `META.json` file, so add it and a `make` target to fill in the version from `Cargo.toml`. Add `.gitattributes` to prevent `git archive` from archiving some files (should more be omitted from the release? What about the `.cargo` directory?) and `.github/workflows/pgxn-release.yml` to do the actual release when a tag is pushed. Also tweak the `README` a bit to address some inconsistencies.
- Loading branch information
Showing
6 changed files
with
92 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gitignore export-ignore | ||
.gitattributes export-ignore | ||
.github export-ignore | ||
*.bak export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: ⚙️ Release on PGXN | ||
on: | ||
push: | ||
tags: [v*] | ||
branches: [pgxn] | ||
jobs: | ||
release: | ||
name: Release on PGXN | ||
runs-on: ubuntu-latest | ||
container: pgxn/pgxn-tools | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Bundle the Release | ||
run: make META.json.bak && pgxn-bundle | ||
- name: Release on PGXN | ||
env: | ||
PGXN_USERNAME: ${{ secrets.PGXN_USERNAME }} | ||
PGXN_PASSWORD: ${{ secrets.PGXN_PASSWORD }} | ||
# run: pgxn-release | ||
run: ls -lah |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ docker/** | |
*.deb | ||
poetry.lock | ||
site | ||
*.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "pgmq", | ||
"abstract": "A lightweight message queue like AWS SQS or RSMQ, but on Postgres", | ||
"description": "A lightweight message queue for PostgreSQL, like AWS SQS or RSMQ, but entirely in the database.", | ||
"version": "@CARGO_VERSION@", | ||
"maintainer": [ | ||
"Tembo <[email protected]>" | ||
], | ||
"license": "postgresql", | ||
"provides": { | ||
"pgmq": { | ||
"abstract": "A lightweight message queue like AWS SQS or RSMQ, but on Postgres", | ||
"file": "src/sql_src.sql", | ||
"docfile": "README.md", | ||
"version": "@CARGO_VERSION@" | ||
} | ||
}, | ||
"prereqs": { | ||
"runtime": { | ||
"requires": { | ||
"PostgreSQL": "11.0.0" | ||
}, | ||
"recommends": { | ||
"pg_partman": "4.5.1" | ||
} | ||
} | ||
}, | ||
"resources": { | ||
"bugtracker": { | ||
"web": "https://github.com/tembo-io/pgmq/issues/" | ||
}, | ||
"repository": { | ||
"url": "git://github.com/tembo-io/pgmq.git", | ||
"web": "https://github.com/tembo-io/pgmq/", | ||
"type": "git" | ||
} | ||
}, | ||
"generated_by": "David E. Wheeler", | ||
"meta-spec": { | ||
"version": "1.0.0", | ||
"url": "https://pgxn.org/meta/spec.txt" | ||
}, | ||
"tags": [ | ||
"mq", | ||
"message queue", | ||
"sqs", | ||
"rsmq" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,21 +68,20 @@ Community | |
|
||
## SQL Examples | ||
|
||
|
||
```bash | ||
# Connect to Postgres | ||
psql postgres://postgres:[email protected]:5432/postgres | ||
``` | ||
|
||
```sql | ||
-- create the extension | ||
-- create the extension in the "pgmq" schema | ||
CREATE EXTENSION pgmq; | ||
``` | ||
|
||
### Creating a queue | ||
|
||
Every queue is its own table in Postgres. The table name is the queue name prefixed with `q_`. | ||
For example, `q_my_queue` is the table for the queue `my_queue`. | ||
Every queue is its own table in the `pgmq` schema. The table name is the queue name prefixed with `q_`. | ||
For example, `pgmq.q_my_queue` is the table for the queue `my_queue`. | ||
|
||
```sql | ||
-- creates the queue | ||
|
@@ -121,11 +120,11 @@ The message id is returned from the send function. | |
### Read messages | ||
|
||
Read `2` message from the queue. Make them invisible for `30` seconds. | ||
If the messages are not deleted or archived within 30 seconds, they will become visible again | ||
and can be read by another consumer. | ||
If the messages are not deleted or archived within 30 seconds, they will become visible again | ||
and can be read by another consumer. | ||
|
||
```sql | ||
SELECT pgmq.read('my_queue', 30, 2); | ||
SELECT * FROM pgmq.read('my_queue', 30, 2); | ||
``` | ||
|
||
```text | ||
|
@@ -161,11 +160,10 @@ SELECT pgmq.pop('my_queue'); | |
|
||
### Archive a message | ||
|
||
Archiving a message removes it from the queue, and inserts it to the archive table. | ||
|
||
Archive message with msg_id=2. | ||
Archiving a message removes it from the queue and inserts it to the archive table. | ||
|
||
```sql | ||
-- Archive message with msg_id=2. | ||
SELECT pgmq.archive('my_queue', 2); | ||
``` | ||
|
||
|
@@ -176,8 +174,8 @@ SELECT pgmq.archive('my_queue', 2); | |
(1 row) | ||
``` | ||
|
||
Archive tables have the prefix `a_`: | ||
```sql | ||
-- Archive tables have the prefix `a_`: | ||
SELECT * FROM pgmq.a_my_queue; | ||
``` | ||
|
||
|