sequel-pgt_outbox 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/.version.txt +1 -1
- data/CHANGELOG.md +7 -0
- data/Readme.adoc +40 -0
- data/ci/build_image.sh +2 -2
- data/exe/outboxify +29 -0
- data/lib/sequel/pgt_outbox/version.rb +1 -1
- data/oci/Gemfile +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a65409e2b6e2552abc4834cae558cf3e1dae99d9b512872c21a5d060d75b5119
|
4
|
+
data.tar.gz: 6fb88398a5b6bfe6449834b37017bfca340f7a25a8de45f90bb33d8ef8ea6c66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2df083e175a7f76457e0a19f71e843130703951c82f7c8cfa0dd456359f392207c1931775911f4ac35754fbea6d62cacb874d2b1ba032d1ffe3b8b17d7465a1f
|
7
|
+
data.tar.gz: 79ea5a168a688ad074f5babf5cb891e35f73bc9a02a411337cd6f44455374842326e7734ecc80cac80d2a0fe6c8d586d392e84be24172d97a9f243169a1b29b1
|
data/.version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.3](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.2...v0.2.3) (2025-02-15)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* Add `outboxify` cli ([#8](https://github.com/rubyists/sequel-pgt_outbox/issues/8)) ([f9e299f](https://github.com/rubyists/sequel-pgt_outbox/commit/f9e299f1e86936879d1794dd44f2364ce6bc1ae5))
|
9
|
+
|
3
10
|
## [0.2.2](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.1...v0.2.2) (2025-02-15)
|
4
11
|
|
5
12
|
|
data/Readme.adoc
CHANGED
@@ -63,6 +63,46 @@ irb(main):007> DB[:foo_outbox].first
|
|
63
63
|
metadata: nil}
|
64
64
|
```
|
65
65
|
|
66
|
+
### Using `outboxify`
|
67
|
+
|
68
|
+
```bash
|
69
|
+
% psql spgt_test
|
70
|
+
psql (16.4)
|
71
|
+
Type "help" for help.
|
72
|
+
|
73
|
+
spgt_test=# create table foo (id serial primary key, s text, i integer);
|
74
|
+
CREATE TABLE
|
75
|
+
spgt_test=# \d
|
76
|
+
List of relations
|
77
|
+
Schema | Name | Type | Owner
|
78
|
+
--------+------------+----------+----------
|
79
|
+
public | foo | table | bougyman
|
80
|
+
public | foo_id_seq | sequence | bougyman
|
81
|
+
(2 rows)
|
82
|
+
|
83
|
+
spgt_test=# \q
|
84
|
+
bougyman@framezotz ~/rubyists/sequel-pgt_outbox
|
85
|
+
% be ./exe/outboxify postgres:///spgt_test foo
|
86
|
+
bougyman@framezotz ~/rubyists/sequel-pgt_outbox
|
87
|
+
% psql spgt_test
|
88
|
+
psql (16.4)
|
89
|
+
Type "help" for help.
|
90
|
+
|
91
|
+
spgt_test=# \d foo
|
92
|
+
Table "public.foo"
|
93
|
+
Column | Type | Collation | Nullable | Default
|
94
|
+
--------+---------+-----------+----------+---------------------------------
|
95
|
+
id | integer | | not null | nextval('foo_id_seq'::regclass)
|
96
|
+
s | text | | |
|
97
|
+
i | integer | | |
|
98
|
+
Indexes:
|
99
|
+
"foo_pkey" PRIMARY KEY, btree (id)
|
100
|
+
Triggers:
|
101
|
+
pgt_outbox_foo_outbox AFTER INSERT OR DELETE OR UPDATE ON foo FOR EACH ROW EXECUTE FUNCTION pgt_outbox_foo_outbox()
|
102
|
+
|
103
|
+
spgt_test=#
|
104
|
+
```
|
105
|
+
|
66
106
|
## Development
|
67
107
|
|
68
108
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/ci/build_image.sh
CHANGED
@@ -209,7 +209,7 @@ fi
|
|
209
209
|
service=$(basename "$owner_and_repo" .git)
|
210
210
|
owner=$(dirname "$owner_and_repo")
|
211
211
|
|
212
|
-
full_tag=$IMAGE_NAME:$tag
|
212
|
+
full_tag=$IMAGE_NAME:$tag
|
213
213
|
# Pass any extra arguments to the build command ("$@" contains the rest of the arguments)
|
214
214
|
$runtime build --tag "$full_tag" "$@" \
|
215
215
|
--label org.opencontainers.image.created="$(date --utc --iso-8601=seconds)" \
|
@@ -237,7 +237,7 @@ fi
|
|
237
237
|
mapfile -t tags < <(echo "$tag" | awk -F'.' 'NF==3{print; print $1"."$2; print $1; next} NF==2{print; print $1; next} {print}')
|
238
238
|
for t in "${tags[@]}"
|
239
239
|
do
|
240
|
-
new_tag=$IMAGE_NAME:$t
|
240
|
+
new_tag=$IMAGE_NAME:$t
|
241
241
|
registry_image_name="$REGISTRY/$owner/$new_tag"
|
242
242
|
if [ "$runtime" = "podman" ]
|
243
243
|
then
|
data/exe/outboxify
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'sequel/pgt_outbox'
|
5
|
+
require 'optparse'
|
6
|
+
|
7
|
+
opts = OptionParser.new do |o|
|
8
|
+
o.banner = 'Usage: outboxify [options] <db uri> <table>'
|
9
|
+
end
|
10
|
+
|
11
|
+
db_uri = ARGV.shift
|
12
|
+
if db_uri.nil?
|
13
|
+
warn 'missing db uri'
|
14
|
+
puts opts
|
15
|
+
exit 1
|
16
|
+
end
|
17
|
+
|
18
|
+
DB = Sequel.connect db_uri
|
19
|
+
DB.extension :pgt_outbox
|
20
|
+
|
21
|
+
table = ARGV.shift
|
22
|
+
if table.nil?
|
23
|
+
warn 'missing table'
|
24
|
+
puts opts
|
25
|
+
exit 2
|
26
|
+
end
|
27
|
+
|
28
|
+
function = DB.pgt_outbox_setup(table)
|
29
|
+
DB.pgt_outbox_events(table, function)
|
data/oci/Gemfile
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-pgt_outbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bougyman
|
@@ -28,7 +28,8 @@ description: This implements a configurable outbox and triggers to populate it w
|
|
28
28
|
details. To be this clear, this only handles the insert of events into the outbox
|
29
29
|
email:
|
30
30
|
- bougyman@users.noreply.github.com
|
31
|
-
executables:
|
31
|
+
executables:
|
32
|
+
- outboxify
|
32
33
|
extensions: []
|
33
34
|
extra_rdoc_files: []
|
34
35
|
files:
|
@@ -44,6 +45,7 @@ files:
|
|
44
45
|
- Readme.adoc
|
45
46
|
- ci/build_image.sh
|
46
47
|
- ci/publish-gem.sh
|
48
|
+
- exe/outboxify
|
47
49
|
- lib/sequel/extensions/pgt_outbox.rb
|
48
50
|
- lib/sequel/pgt_outbox.rb
|
49
51
|
- lib/sequel/pgt_outbox/database_methods.rb
|