sequel-pgt_outbox 0.2.4 → 0.2.6
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 +14 -0
- data/Readme.adoc +64 -14
- data/lib/sequel/pgt_outbox/version.rb +1 -1
- data/oci/Gemfile +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a404cb73996a6861aa16cd7b019bd8c204ddb61a32b104ee8d5fa27586c66a
|
4
|
+
data.tar.gz: c42b48956721b67f16f15e2830fc37d866426b8fc0956488e431d9b6a885fd79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b6c99927c37acb1d2afd44d3fe383e278be2a77ea8fdde20783a67f9c576a64ce955639a051798807add8b08f1bc800fa0ad833d37c98a40da35c8076f45706
|
7
|
+
data.tar.gz: 587d1b67805e2f43cad2f9bb12e36930be4a4c544545f3e009e570a40ef972f8f5f07ccfe994852131c3d484d3ebc0ae939e49db04d39020f03c902d48e42d13
|
data/.version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.2.6](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.5...v0.2.6) (2025-02-16)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Again with the transactional language, and force a release ([#21](https://github.com/rubyists/sequel-pgt_outbox/issues/21)) ([18b1824](https://github.com/rubyists/sequel-pgt_outbox/commit/18b1824c2592fbca2ca83928c521436c04696703))
|
9
|
+
|
10
|
+
## [0.2.5](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.4...v0.2.5) (2025-02-16)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* Correct docs so that extension is used ([#13](https://github.com/rubyists/sequel-pgt_outbox/issues/13)) ([c050c5e](https://github.com/rubyists/sequel-pgt_outbox/commit/c050c5e831e3285b4b2168150ed3ea66dea680e6))
|
16
|
+
|
3
17
|
## [0.2.4](https://github.com/rubyists/sequel-pgt_outbox/compare/v0.2.3...v0.2.4) (2025-02-16)
|
4
18
|
|
5
19
|
|
data/Readme.adoc
CHANGED
@@ -1,12 +1,45 @@
|
|
1
|
-
=
|
2
|
-
:
|
1
|
+
= Transactional Outbox for PostgreSQL
|
2
|
+
:toc:
|
3
|
+
:outbox-pattern: https://morningcoffee.io/what-is-a-transaction-outbox-and-why-you-need-it.html[outbox pattern]
|
4
|
+
:postgresql: https://www.postgresql.org/[PostgreSQL]
|
5
|
+
:sequel: https://sequel.jeremyevans.net/[Sequel]
|
6
|
+
:eventide: https://eventide-project.org/[Eventide]
|
7
|
+
:rails-event-store: https://railseventstore.org/[Rails Event Store]
|
8
|
+
:tobox: https://gitlab.com/os85/tobox[Tobox]
|
9
|
+
:release-please: https://github.com/googleapis/release-please[release-please]
|
10
|
+
:conventional-commits: https://www.conventionalcommits.org/en/v1.0.0/[Conventional Commits]
|
11
|
+
:github-home: https://github.com/rubyists/sequel-pgt_outbox
|
12
|
+
:coc: https://github.com/rubyists/sequel-pgt_outbox/blob/main/CODE_OF_CONDUCT.md[Code of Conduct]
|
13
|
+
:mit: https://opensource.org/licenses/MIT[MIT License]
|
14
|
+
|
15
|
+
image::https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg[Conventional Commits,link=https://www.conventionalcommits.org/en/v1.0.0/]
|
16
|
+
|
17
|
+
== Wtf?
|
18
|
+
|
19
|
+
This gem provides a way to implement the transactional {outbox-pattern} using triggers
|
20
|
+
(stored procedures) in the {postgresql} RDBMS.
|
21
|
+
|
22
|
+
This only provides the "writing events to the outbox table" part of the outbox pattern.
|
23
|
+
It does not provide the "reading and handling events from the outbox table" part.
|
24
|
+
That is up to the application to implement.
|
25
|
+
|
26
|
+
There are many libraries that can be used to read and handle events from the outbox table,
|
27
|
+
among them are:
|
28
|
+
|
29
|
+
- {eventide}
|
30
|
+
- {rails-event-store}
|
31
|
+
- {tobox}
|
32
|
+
|
33
|
+
PgtOutbox utilizes the ruby {sequel} ORM to interact with the database, but once it's set up,
|
34
|
+
it doesn't require any ruby nor {sequel} code for the outbox population to operate. It
|
35
|
+
all runs on the {postgresql} cluster, guaranteeing no matter how the database writes
|
36
|
+
occur, the outbox events will always be generated.
|
3
37
|
|
4
|
-
|
38
|
+
== Features
|
5
39
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
occur, the outbox events will always be generated.
|
40
|
+
* Create outbox table(s) to store events
|
41
|
+
* Create function(s) to write events to outbox table
|
42
|
+
* Create trigger(s) to attach to tables so their changes write events to the outbox(es)
|
10
43
|
|
11
44
|
== Installation
|
12
45
|
|
@@ -27,8 +60,10 @@ gem install sequel-pgt_outbox
|
|
27
60
|
### Using the sequel cli
|
28
61
|
|
29
62
|
```bash
|
30
|
-
sequel -r sequel/pgt_outbox postgres
|
63
|
+
sequel -r sequel/pgt_outbox postgres:///spgt_test
|
31
64
|
Your database is stored in DB...
|
65
|
+
irb(main):000> DB.extension :pgt_output
|
66
|
+
=> #<Sequel::Postgres::Database database=spgt_test>
|
32
67
|
irb(main):001> DB.create_table(:foo) { primary_key :id; String :s; Integer :i }
|
33
68
|
=> nil
|
34
69
|
irb(main):002> function = DB.pgt_setup_outbox(:foo)
|
@@ -83,7 +118,7 @@ spgt_test=# \d
|
|
83
118
|
|
84
119
|
spgt_test=# \q
|
85
120
|
bougyman@framezotz ~/rubyists/sequel-pgt_outbox
|
86
|
-
%
|
121
|
+
% outboxify postgres:///spgt_test foo
|
87
122
|
bougyman@framezotz ~/rubyists/sequel-pgt_outbox
|
88
123
|
% psql spgt_test
|
89
124
|
psql (16.4)
|
@@ -106,18 +141,33 @@ spgt_test=#
|
|
106
141
|
|
107
142
|
## Development
|
108
143
|
|
109
|
-
After checking out the repo, run `
|
144
|
+
After checking out the repo, run `bundle install` or `bin/setup` to install dependencies.
|
145
|
+
|
146
|
+
Then, either set the PGT_SPEC_DB environment variable to an existing PostgreSQL db of your choice,
|
147
|
+
or run `rake createdb` to create a testing one (`spgt_test`).
|
148
|
+
|
149
|
+
Finally run `rake spec` to run the tests.
|
150
|
+
|
151
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
152
|
+
|
153
|
+
To install this gem from source onto your local machine, run `bundle exec rake install`.
|
154
|
+
|
155
|
+
### Conventional Commits & Commit Messages
|
110
156
|
|
111
|
-
|
157
|
+
This project uses the {conventional-commits} specification for commit messages, as well as for PR titles.
|
158
|
+
This allows for automated (by {release-please}) release management, changelog generation, and versioning.
|
159
|
+
Please follow the specification when writing commit messages.
|
112
160
|
|
113
161
|
## Contributing
|
114
162
|
|
115
|
-
Bug reports and pull requests are welcome on GitHub at
|
163
|
+
Bug reports and pull requests are welcome on GitHub at {github-home}.
|
164
|
+
Discussions are welcome in the discussions section of the repository.
|
116
165
|
|
117
166
|
## License
|
118
167
|
|
119
|
-
The gem is available as open source under the terms of the
|
168
|
+
The gem is available as open source under the terms of the {mit}.
|
120
169
|
|
121
170
|
## Code of Conduct
|
122
171
|
|
123
|
-
Everyone interacting in the
|
172
|
+
Everyone interacting in the PgtOutbox project's codebases, issue trackers,
|
173
|
+
and discussions is expected to follow the {coc}.
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bougyman
|
@@ -81,5 +81,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
requirements: []
|
82
82
|
rubygems_version: 3.6.2
|
83
83
|
specification_version: 4
|
84
|
-
summary: Triggers to implement a
|
84
|
+
summary: Triggers to implement (an important) part of a transactional outbox pattern.
|
85
85
|
test_files: []
|