sequel-pgt_outbox 0.2.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d856379948fad6e85dee5844e6cb8c290e85aac19491898ec6c0ad36f7479e59
4
- data.tar.gz: 96a25fb9ce1c9b2b01f52e0f0de336001f396a8c678eaf6291010aab4421e57e
3
+ metadata.gz: a65409e2b6e2552abc4834cae558cf3e1dae99d9b512872c21a5d060d75b5119
4
+ data.tar.gz: 6fb88398a5b6bfe6449834b37017bfca340f7a25a8de45f90bb33d8ef8ea6c66
5
5
  SHA512:
6
- metadata.gz: 1adb911c3165d01062c9eb58ef6854388610409285ef5da19c111c4b6f8e63c86b53f7436d04b4b352b062484d7cac320d5df4d869c2f66f9d05d25d68620d03
7
- data.tar.gz: 3ad33140421494eab11e0d5ef4ce03e882872f518324d0b0519820b9282a70ded088c08a5a488baa98683fc1cd2ed60beb2e092069cd7374883d1cbbe7d1b5a2
6
+ metadata.gz: 2df083e175a7f76457e0a19f71e843130703951c82f7c8cfa0dd456359f392207c1931775911f4ac35754fbea6d62cacb874d2b1ba032d1ffe3b8b17d7465a1f
7
+ data.tar.gz: 79ea5a168a688ad074f5babf5cb891e35f73bc9a02a411337cd6f44455374842326e7734ecc80cac80d2a0fe6c8d586d392e84be24172d97a9f243169a1b29b1
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.2.1"
2
+ ".": "0.2.3"
3
3
  }
data/.version.txt CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
10
+ ## [0.2.2](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.1...v0.2.2) (2025-02-15)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Corrects github remote to origin and ignores rubygems api checksum ([#6](https://github.com/rubyists/sequel-pgt_outbox/issues/6)) ([eb2e557](https://github.com/rubyists/sequel-pgt_outbox/commit/eb2e55743fb13a30427bbcc3ffd71a9c17f1972e))
16
+
3
17
  ## [0.2.1](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.0...v0.2.1) (2025-02-15)
4
18
 
5
19
 
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
@@ -194,7 +194,7 @@ fi
194
194
 
195
195
  revision=$(git rev-parse HEAD)
196
196
  shortref=$(git rev-parse --short "$revision")
197
- repo_url=$(git remote get-url upstream)
197
+ repo_url=$(git remote get-url origin)
198
198
  if [ -z "$repo_url" ]
199
199
  then
200
200
  die 7 "No remote found"
@@ -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-ruby$RUBY_VERSION-$UBUNTU_VERSION
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-ruby$RUBY_VERSION-$UBUNTU_VERSION
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)
@@ -3,7 +3,7 @@
3
3
  module Rubyists
4
4
  module PgtOutbox
5
5
  # x-release-please-start-version
6
- VERSION = '0.2.1'
6
+ VERSION = '0.2.3'
7
7
  # x-release-please-end
8
8
  end
9
9
  end
data/oci/Containerfile CHANGED
@@ -22,6 +22,7 @@ RUN mkdir -p ./vendor/cache && \
22
22
  bundle exec rake build && \
23
23
  mv pkg/*.gem ./vendor/cache/ && \
24
24
  cp oci/Gemfile . && \
25
+ bundle config set --local disable_checksum_validation true && \
25
26
  bundle install --jobs $JOBS
26
27
 
27
28
  # Remove folders not needed in resulting image
data/oci/Gemfile CHANGED
@@ -3,5 +3,5 @@
3
3
  source 'https://rubygems.org'
4
4
 
5
5
  # x-release-please-start-version
6
- gem 'sequel-pgt_outbox', '= 0.2.1'
6
+ gem 'sequel-pgt_outbox', '= 0.2.3'
7
7
  # x-release-please-end
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.1
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