File tree 3 files changed +11
-4
lines changed
3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS outbox_messages
39
39
published_at TIMESTAMP
40
40
);
41
41
42
- CREATE INDEX idx_outbox_messages_published_at ON outbox_messages (published_at);
42
+ CREATE INDEX IF NOT EXISTS idx_outbox_messages_published_at_null ON outbox_messages (published_at) WHERE published_at IS NULL ;
43
43
```
44
44
45
45
The outbox table name can be customized, but the table structure should remain exactly the same.
@@ -128,4 +128,10 @@ Source code and instructions for the example are located in the [examples/01_sns
128
128
129
129
## Stargazers over time
130
130
131
- [ ![ Stargazers over time] ( https://starchart.cc/nikolayk812/pgx-outbox.svg?variant=adaptive )] ( https://starchart.cc/nikolayk812/pgx-outbox )
131
+ [ ![ Stargazers over time] ( https://starchart.cc/nikolayk812/pgx-outbox.svg?variant=adaptive )] ( https://starchart.cc/nikolayk812/pgx-outbox )
132
+
133
+ ## Alternatives
134
+
135
+ - [ Trendyol/go-pq-cdc] ( https://github.com/Trendyol/go-pq-cdc ) - Change Data Capture (CDC) library for PostgreSQL
136
+ - [ watermill-sql] ( https://github.com/ThreeDotsLabs/watermill-sql ) - PostgreSQL Pub/Sub for Watermill
137
+ - [ dataddo/pgq] ( https://github.com/dataddo/pgq ) - Go queue implementation using PostgreSQL
Original file line number Diff line number Diff line change 1
- DROP INDEX IF EXISTS idx_outbox_messages_published_at ;
1
+ DROP INDEX IF EXISTS idx_outbox_messages_published_at_null ;
2
2
DROP TABLE IF EXISTS outbox_messages;
Original file line number Diff line number Diff line change @@ -11,4 +11,5 @@ CREATE TABLE IF NOT EXISTS outbox_messages
11
11
published_at TIMESTAMP
12
12
);
13
13
14
- CREATE INDEX IF NOT EXISTS idx_outbox_messages_published_at ON outbox_messages (published_at);
14
+ -- https://www.postgresql.org/docs/current/indexes-partial.html
15
+ CREATE INDEX IF NOT EXISTS idx_outbox_messages_published_at_null ON outbox_messages (published_at) WHERE published_at IS NULL ;
You can’t perform that action at this time.
0 commit comments