Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename pgmq extension #106

Merged
merged 3 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions extensions/pgx_pgmq/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions extensions/pgx_pgmq/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "pgx_pgmq"
name = "pgmq"
version = "0.0.4"
edition = "2021"
authors = ["CoreDB.io"]
Expand All @@ -8,7 +8,7 @@ homepage = "https://www.coredb.io"
license = "MIT"
readme = "README.md"
repository = "https://github.com/CoreDB-io/coredb"

publish = false

[lib]
crate-type = ["cdylib"]
Expand All @@ -25,7 +25,7 @@ pg_test = []
[dependencies]
pgx = "0.7.1"
serde = "1.0.152"
pgmq = "0.5.1"
pgmq_crate = { package = "pgmq", version = "0.7.0" }
serde_json = "1.0.91"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion extensions/pgx_pgmq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pgmq=# SELECT * from pgmq_read('my_queue', 30, 2);
If the queue is empty, or if all messages are currently invisible, no rows will be returned.

```sql
pgx_pgmq=# SELECT * from pgmq_read('my_queue', 30, 1);
pgmq=# SELECT * from pgmq_read('my_queue', 30, 1);
msg_id | read_ct | vt | enqueued_at | message
--------+---------+----+-------------+---------
```
Expand Down
4 changes: 2 additions & 2 deletions extensions/pgx_pgmq/build-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -xe
# This script is for running the action .github/actions/build-extension-package locally

GIT_ROOT=$(git rev-parse --show-toplevel)
THIS_DIR=${GIT_ROOT}/extensions/pgx_pgmq
THIS_DIR=${GIT_ROOT}/extensions/pgmq

# Cleanup files created by this script
function cleanup {
Expand All @@ -24,7 +24,7 @@ docker build . --build-arg UBUNTU_VERSION="22.04" \
--build-arg PGX_VERSION=0.7.1 \
--build-arg PACKAGE_VERSION=0.0.1 \
--build-arg NAME=pgmq \
--build-arg PACKAGE_NAME=pgx_pgmq \
--build-arg PACKAGE_NAME=pgmq \
--build-arg PGVERSION=15 \
-t ${random_tag}
docker run -v $(pwd):/output ${random_tag}
2 changes: 1 addition & 1 deletion extensions/pgx_pgmq/examples/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# create extension
with engine.connect() as con:
# create extension
created = con.execute(text( "create extension if not exists pgx_pgmq;"))
created = con.execute(text( "create extension if not exists pgmq;"))
con.commit()

QUEUE_NAME = 'myqueue'
Expand Down
5 changes: 5 additions & 0 deletions extensions/pgx_pgmq/pgmq.control
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comment = 'pgmq: Created by pgx'
default_version = '@CARGO_VERSION@'
module_pathname = '$libdir/pgmq'
relocatable = false
superuser = false
5 changes: 0 additions & 5 deletions extensions/pgx_pgmq/pgx_pgmq.control

This file was deleted.

4 changes: 2 additions & 2 deletions extensions/pgx_pgmq/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use pgx::warning;

pgx::pg_module_magic!();

use pgmq::query::{delete, enqueue_str, init_queue, pop, read};
use pgmq_crate::query::{delete, enqueue_str, init_queue, pop, read};

#[pg_extern]
fn pgmq_create(queue_name: &str) -> Result<(), spi::Error> {
Expand Down Expand Up @@ -208,7 +208,7 @@ fn listit() -> Result<Vec<(String, TimestampWithTimeZone)>, spi::Error> {
#[pg_schema]
mod tests {
use crate::*;
use pgmq::query::TABLE_PREFIX;
use pgmq_crate::query::TABLE_PREFIX;
// use pgx::prelude::*;
#[pg_test]
fn test_create() {
Expand Down