message-db 2.0.2 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/database/VERSION.txt +1 -1
- data/database/functions/get-category-messages.sql +7 -3
- data/database/functions/get-stream-messages.sql +8 -4
- data/database/functions/message-store-version.sql +1 -1
- data/database/install.sh +16 -1
- data/database/privileges/functions.sql +0 -1
- data/database/tables/messages.sql +4 -4
- data/database/uninstall.sh +0 -1
- data/database/update/1.0.0.md +11 -11
- data/database/update/1.2.2.md +12 -0
- data/database/update/1.2.2.sh +65 -0
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d86b37efb68b4f46fc655a3fc4f7ba8e7657197965087972bf4e8832f39f8a9e
|
4
|
+
data.tar.gz: 3ab551d95e717b5acc59774669f2b3d686ba0f2ffe0070b58d6dcb87344b1e06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ca747525f2d3310df2420e5c4df5317585a2eca6ce88c7ba98616baf9dd2f0e9b8e84313d6c48599105855a4e9d5d1147330958ebbc28d0b892d2e70a1ca5bd
|
7
|
+
data.tar.gz: ca065829c7c968546e903789a3d877f4513f27a4a06503578ddf43601fe53f284f15ccdb969ac770fb1d387fd289070cf8e03573a4151f3578c97b976f4aa0ba
|
data/database/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.4
|
@@ -101,9 +101,13 @@ BEGIN
|
|
101
101
|
|
102
102
|
_command := _command || '
|
103
103
|
ORDER BY
|
104
|
-
global_position ASC
|
105
|
-
|
106
|
-
|
104
|
+
global_position ASC';
|
105
|
+
|
106
|
+
IF get_category_messages.batch_size != -1 THEN
|
107
|
+
_command := _command || '
|
108
|
+
LIMIT
|
109
|
+
$3';
|
110
|
+
END IF;
|
107
111
|
|
108
112
|
IF current_setting('message_store.debug_get', true) = 'on' OR current_setting('message_store.debug', true) = 'on' THEN
|
109
113
|
RAISE NOTICE '» get_category_messages';
|
@@ -49,9 +49,13 @@ BEGIN
|
|
49
49
|
|
50
50
|
_command := _command || '
|
51
51
|
ORDER BY
|
52
|
-
position ASC
|
53
|
-
|
54
|
-
|
52
|
+
position ASC';
|
53
|
+
|
54
|
+
IF get_stream_messages.batch_size != -1 THEN
|
55
|
+
_command := _command || '
|
56
|
+
LIMIT
|
57
|
+
$3';
|
58
|
+
END IF;
|
55
59
|
|
56
60
|
IF current_setting('message_store.debug_get', true) = 'on' OR current_setting('message_store.debug', true) = 'on' THEN
|
57
61
|
RAISE NOTICE '» get_stream_messages';
|
@@ -60,7 +64,7 @@ BEGIN
|
|
60
64
|
RAISE NOTICE 'batch_size ($3): %', get_stream_messages.batch_size;
|
61
65
|
RAISE NOTICE 'condition ($4): %', get_stream_messages.condition;
|
62
66
|
RAISE NOTICE 'Generated Command: %', _command;
|
63
|
-
|
67
|
+
END IF;
|
64
68
|
|
65
69
|
RETURN QUERY EXECUTE _command USING
|
66
70
|
get_stream_messages.stream_name,
|
data/database/install.sh
CHANGED
@@ -22,6 +22,17 @@ else
|
|
22
22
|
database=$DATABASE_NAME
|
23
23
|
fi
|
24
24
|
|
25
|
+
|
26
|
+
if [ -z ${CREATE_DATABASE+x} ]; then
|
27
|
+
CREATE_DATABASE="on"
|
28
|
+
fi
|
29
|
+
|
30
|
+
create_database=true
|
31
|
+
if [ "$CREATE_DATABASE" = "off" ] ; then
|
32
|
+
create_database=false
|
33
|
+
fi
|
34
|
+
|
35
|
+
|
25
36
|
if [ -z ${PGOPTIONS+x} ]; then
|
26
37
|
export PGOPTIONS='-c client_min_messages=warning'
|
27
38
|
fi
|
@@ -66,7 +77,11 @@ echo
|
|
66
77
|
|
67
78
|
echo "Creating Database"
|
68
79
|
echo "- - -"
|
69
|
-
|
80
|
+
if [ "$create_database" = true ] ; then
|
81
|
+
create-database
|
82
|
+
else
|
83
|
+
echo "Database creation is deactivated. Not creating the database."
|
84
|
+
fi
|
70
85
|
echo
|
71
86
|
|
72
87
|
echo "Creating Schema"
|
@@ -1,5 +1,4 @@
|
|
1
1
|
GRANT EXECUTE ON FUNCTION gen_random_uuid() TO message_store;
|
2
|
-
GRANT EXECUTE ON FUNCTION md5(text) TO message_store;
|
3
2
|
|
4
3
|
GRANT EXECUTE ON FUNCTION message_store.acquire_lock(varchar) TO message_store;
|
5
4
|
GRANT EXECUTE ON FUNCTION message_store.cardinal_id(varchar) TO message_store;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
CREATE TABLE IF NOT EXISTS message_store.messages (
|
2
|
-
|
2
|
+
global_position bigserial NOT NULL,
|
3
|
+
position bigint NOT NULL,
|
4
|
+
time TIMESTAMP WITHOUT TIME ZONE DEFAULT (now() AT TIME ZONE 'utc') NOT NULL,
|
3
5
|
stream_name text NOT NULL,
|
4
6
|
type text NOT NULL,
|
5
|
-
position bigint NOT NULL,
|
6
|
-
global_position bigserial NOT NULL,
|
7
7
|
data jsonb,
|
8
8
|
metadata jsonb,
|
9
|
-
|
9
|
+
id UUID NOT NULL DEFAULT gen_random_uuid()
|
10
10
|
);
|
11
11
|
|
12
12
|
ALTER TABLE message_store.messages ADD PRIMARY KEY (global_position) NOT DEFERRABLE INITIALLY IMMEDIATE;
|
data/database/uninstall.sh
CHANGED
data/database/update/1.0.0.md
CHANGED
@@ -6,21 +6,21 @@ The following changes are made by the 1.0.0.sh update script:
|
|
6
6
|
|
7
7
|
- **Note: There are no changes to the `messages` table, and no data migration is necessary**
|
8
8
|
- The executables named `evt-pg-*` are renamed to `mdb-*`
|
9
|
-
- **[breaking change]** The `get_category_messages` server function supports pub/sub directly by receiving a `correlation` argument and composing the correlation metadata query condition directly in the server function ([http://docs.eventide-project.org/user-guide/message-
|
9
|
+
- **[breaking change]** The `get_category_messages` server function supports pub/sub directly by receiving a `correlation` argument and composing the correlation metadata query condition directly in the server function ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-messages-from-a-category](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-messages-from-a-category))
|
10
10
|
- **[breaking change]** The message_store database and its objects are contained in a Postgres schema named `message_store`
|
11
|
-
- **[breaking change]** The `get_category_messages` server function supports consumer groups via the `consumer_group_member` and `consumer_group_size` parameters ([http://docs.eventide-project.org/user-guide/message-
|
12
|
-
- The retrieval server functions provide debugging output that is activated via the Postgres setting, `message_store.debug_get` ([http://docs.eventide-project.org/user-guide/message-
|
13
|
-
- The write server function provides debugging output that is activated via the Postgres setting, `message_store.debug_write` ([http://docs.eventide-project.org/user-guide/message-
|
14
|
-
- The `message_store.debug` Postgres setting activates both the retrieval and write debug output ([http://docs.eventide-project.org/user-guide/message-
|
15
|
-
- `id` stream parsing function ([http://docs.eventide-project.org/user-guide/message-
|
16
|
-
- `cardinal_id` stream parsing function ([http://docs.eventide-project.org/user-guide/message-
|
17
|
-
- `acquire_lock` function encapsulates the application of the advisory lock used by the `write_message` function ([http://docs.eventide-project.org/user-guide/message-
|
11
|
+
- **[breaking change]** The `get_category_messages` server function supports consumer groups via the `consumer_group_member` and `consumer_group_size` parameters ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-messages-from-a-category](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-messages-from-a-category))
|
12
|
+
- The retrieval server functions provide debugging output that is activated via the Postgres setting, `message_store.debug_get` ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#debugging-output](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#debugging-output))
|
13
|
+
- The write server function provides debugging output that is activated via the Postgres setting, `message_store.debug_write` ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#debugging-output](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#debugging-output))
|
14
|
+
- The `message_store.debug` Postgres setting activates both the retrieval and write debug output ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#debugging-output](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#debugging-output))
|
15
|
+
- `id` stream parsing function ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-the-id-from-a-stream-name](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-the-id-from-a-stream-name))
|
16
|
+
- `cardinal_id` stream parsing function ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-the-cardinal-id-from-a-stream-name](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-the-cardinal-id-from-a-stream-name))
|
17
|
+
- `acquire_lock` function encapsulates the application of the advisory lock used by the `write_message` function ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-message-store-database-schema-version](http://docs.eventide-project.org/user-guide/message-db/server-functions.html#get-message-store-database-schema-version))
|
18
18
|
- Database management tool output is clarified
|
19
|
-
- **[breaking change]** All server function parameter names are no longer named with underscore prefixes ([http://docs.eventide-project.org/user-guide/message-
|
20
|
-
- Indexes are no longer built with the `CONCURRENTLY` option ([http://docs.eventide-project.org/user-guide/message-
|
19
|
+
- **[breaking change]** All server function parameter names are no longer named with underscore prefixes ([http://docs.eventide-project.org/user-guide/message-db/server-functions.html](http://docs.eventide-project.org/user-guide/message-db/server-functions.html))
|
20
|
+
- Indexes are no longer built with the `CONCURRENTLY` option ([http://docs.eventide-project.org/user-guide/message-db/anatomy.html#source-code](http://docs.eventide-project.org/user-guide/message-db/anatomy.html#source-code))
|
21
21
|
- **[breaking change]** The `messages_category_global_position_idx` is removed and replaced with the `messages_category` index, which now indexes correlation metadata
|
22
22
|
- **[breaking change]** The `messages_stream_name_position_uniq_idx` is removed and replaced with the `messages_stream` index, which now indexes correlation metadata
|
23
23
|
- **[breaking change]** The `messages_id_uniq_idx` is removed and replaced with the `messages_id` index
|
24
24
|
- Message DB RubyGem: [https://github.com/message-db/ruby-gem](https://github.com/message-db/ruby-gem)
|
25
25
|
- Message DB NPM Module: [https://github.com/message-db/npm-module](https://github.com/message-db/npm-module)
|
26
|
-
- Improvements to interactive tests ([https://github.com/eventide-project/
|
26
|
+
- Improvements to interactive tests ([https://github.com/eventide-project/message-store-postgres/tree/master/test](https://github.com/eventide-project/message-store-postgres/tree/master/test))
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# 1.2.2 Update
|
2
|
+
|
3
|
+
Note: There are no backward-incompatible changes in this update.
|
4
|
+
|
5
|
+
This update requires the execution of the v1.2.2 update script: `1.2.2.sh`. For instructions on applying update scripts, see:
|
6
|
+
|
7
|
+
[http://docs.eventide-project.org/user-guide/message-db/update.html](http://docs.eventide-project.org/user-guide/message-db/update.html)
|
8
|
+
|
9
|
+
The following changes are made by the 1.2.2.sh update script:
|
10
|
+
|
11
|
+
- The `get_category_messages` server function will return the entire, unlimited extent of messages in a category if -1 is sent as the `batch_size` argument
|
12
|
+
- The `get_stream_messages` server function will return the entire, unlimited extent of messages in a stream if -1 is sent as the `batch_size` argument
|
@@ -0,0 +1,65 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
set -e
|
4
|
+
|
5
|
+
echo
|
6
|
+
echo "Message DB"
|
7
|
+
echo
|
8
|
+
echo "Update the message_store database to v1.2.2"
|
9
|
+
echo
|
10
|
+
echo "WARNING:"
|
11
|
+
echo "This script updates a post-v1 message_store database to Message DB v1.2.2"
|
12
|
+
echo "Do not run this script on a Message DB pre-v1 database"
|
13
|
+
echo
|
14
|
+
echo "Fore more information about the changes made to the message store by"
|
15
|
+
echo "this update, see: https://github.com/message-db/message-db/blob/master/database/update/1.2.2.md"
|
16
|
+
echo
|
17
|
+
echo "- Press CTRL+C to stop this script from running"
|
18
|
+
echo "- Press RETURN to allow the script to proceed"
|
19
|
+
echo
|
20
|
+
|
21
|
+
read
|
22
|
+
|
23
|
+
function script_dir {
|
24
|
+
val="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
25
|
+
echo "$val"
|
26
|
+
}
|
27
|
+
|
28
|
+
base="$(script_dir)/.."
|
29
|
+
echo $base
|
30
|
+
|
31
|
+
echo
|
32
|
+
echo "Updating Database"
|
33
|
+
echo "Version: $(cat $base/VERSION.txt)"
|
34
|
+
echo "= = ="
|
35
|
+
|
36
|
+
if [ -z ${DATABASE_NAME+x} ]; then
|
37
|
+
echo "(DATABASE_NAME is not set. Default will be used.)"
|
38
|
+
database=message_store
|
39
|
+
export DATABASE_NAME=$database
|
40
|
+
else
|
41
|
+
database=$DATABASE_NAME
|
42
|
+
fi
|
43
|
+
echo
|
44
|
+
|
45
|
+
if [ -z ${PGOPTIONS+x} ]; then
|
46
|
+
export PGOPTIONS='-c client_min_messages=warning'
|
47
|
+
fi
|
48
|
+
|
49
|
+
function install-functions {
|
50
|
+
echo "» get_stream_messages function"
|
51
|
+
psql $database -q -f $base/functions/get-stream-messages.sql
|
52
|
+
|
53
|
+
echo "» get_category_messages function"
|
54
|
+
psql $database -q -f $base/functions/get-category-messages.sql
|
55
|
+
}
|
56
|
+
|
57
|
+
echo "Installing Functions"
|
58
|
+
echo "- - -"
|
59
|
+
install-functions
|
60
|
+
echo
|
61
|
+
|
62
|
+
echo "= = ="
|
63
|
+
echo "Done Updating Database"
|
64
|
+
echo "Version: $(cat $base/VERSION.txt)"
|
65
|
+
echo
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: message-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: scripts
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " "
|
14
14
|
email: opensource@eventide-project.org
|
@@ -81,6 +81,8 @@ files:
|
|
81
81
|
- database/update.sh
|
82
82
|
- database/update/1.0.0.md
|
83
83
|
- database/update/1.0.0.sh
|
84
|
+
- database/update/1.2.2.md
|
85
|
+
- database/update/1.2.2.sh
|
84
86
|
- database/views/category-type-summary.sql
|
85
87
|
- database/views/stream-summary.sql
|
86
88
|
- database/views/stream-type-summary.sql
|
@@ -110,7 +112,7 @@ homepage: https://github.com/message-db/message-db
|
|
110
112
|
licenses:
|
111
113
|
- MIT
|
112
114
|
metadata: {}
|
113
|
-
post_install_message:
|
115
|
+
post_install_message:
|
114
116
|
rdoc_options: []
|
115
117
|
require_paths:
|
116
118
|
- lib
|
@@ -125,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
127
|
- !ruby/object:Gem::Version
|
126
128
|
version: '0'
|
127
129
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
129
|
-
signing_key:
|
130
|
+
rubygems_version: 3.1.2
|
131
|
+
signing_key:
|
130
132
|
specification_version: 4
|
131
133
|
summary: Microservice native event store and message store for Postgres
|
132
134
|
test_files: []
|