Skip to content

Commit

Permalink
chore: upload *
Browse files Browse the repository at this point in the history
  • Loading branch information
ofceab committed Feb 6, 2025
1 parent d63dfe6 commit 2e16cb2
Show file tree
Hide file tree
Showing 28 changed files with 89 additions and 1,968 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@ Initial version.
- feat: Includes the ability to create, purge, drop a `Queue`.
- feat: Includes the ability to send, read, pop, archive, delete a `Message`.
- feat: Includes the ability to set a `vt` (visibility timeout).

## 2.0.0

- feat: Improve performance by using connection pool.
- feat: Make `Queue` disposable.
- feat: Use postgres as client for pgmq
- feat: Add cancellation on request execution.
- feat: Add support of prisma to manage `Queue`.
- feat: Add fromJson and toJson on `Messsage`.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Dart PGMQ
A dart client for Postgres Message Queue ([PGMQ](https://github.com/tembo-io/pgmq)).

### Usage
### Setup

```bash
# Start a Postgres instance
Expand All @@ -23,7 +23,9 @@ CREATE SCHEMA pgmq;
CREATE EXTENSION pgmq;
```

### Then
### Usage

- With Postgresql

```dart
// Create a database connection
Expand All @@ -46,6 +48,20 @@ final pgmq = await Pgmq.createConnection(param: databaseParam);
final queue = await pgmq.createQueue(queueName: queueName);
```

- With Prisma

```dart
// Create a pgmq connection with PrismaClient
final pgmq = Pgmq.createConnectionUsingPrisma(prismaClient: PrismaClient());
```

```dart
// Create a queue [queueName]
final queue = await pgmq.createQueue(queueName: queueName);
```

### Then

```dart
// Send a message
queue.send({"foo": "bar"});
Expand Down
4 changes: 2 additions & 2 deletions example/example_delete.dart → example/delete.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Future<void> main() async {
final databaseParam = DatabaseConnection(
host: 'localhost',
database: 'postgres',
password: 'password',
password: 'postgres',
username: 'postgres',
ssl: false,
port: 5432);
Expand All @@ -18,7 +18,7 @@ Future<void> main() async {
maxConnection: 5,
));

print("Initialized in ${a.elapsed.inMilliseconds}");
print("Initialized in ${a.elapsed.inMilliseconds}ms");

// Create a queue
final queue = await pgmq.createQueue(queueName: 'test');
Expand Down
6 changes: 0 additions & 6 deletions example/demo/prisma_demo/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions example/demo/prisma_demo/CHANGELOG.md

This file was deleted.

2 changes: 0 additions & 2 deletions example/demo/prisma_demo/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions example/demo/prisma_demo/analysis_options.yaml

This file was deleted.

1 change: 0 additions & 1 deletion example/demo/prisma_demo/bin/prisma.dart

This file was deleted.

1 change: 0 additions & 1 deletion example/demo/prisma_demo/dmmf.json

This file was deleted.

Loading

0 comments on commit 2e16cb2

Please sign in to comment.