Skip to content

Commit 5b499ba

Browse files
committed
Initial commit
0 parents  commit 5b499ba

28 files changed

+299
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_store
2+
.bundle/
3+
Gemfile.lock
4+
*.gem
5+
gems
6+
*scratch*
7+
database

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
3+
gemspec

MIT-License.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015-present Scott Bellware
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Message DB
2+
3+
**Microservice Native Event Store and Message Store for Postgres**
4+
5+
A fully-featured event store and message store implemented entirely in PostgreSQL, supporting event sourcing and messaging applications and services.
6+
7+
## Ruby Distribution of Message DB
8+
9+
This library is a Ruby Gem package of the Message DB database for Postgres.
10+
11+
For more information, see:
12+
13+
[https://github.com/message-db/message-db](https://github.com/message-db/message-db)
14+
15+
This package also includes executable scripts installed into the RubyGems execution search path.
16+
17+
For more information on the executables, see:
18+
19+
[http://docs.eventide-project.org/user-guide/message-db/tools.html](http://docs.eventide-project.org/user-guide/message-db/tools.html)
20+
21+
## Documentation
22+
23+
See the Message DB documentation on the Eventide docs site:
24+
25+
[http://docs.eventide-project.org/user-guide/message-db/](http://docs.eventide-project.org/user-guide/message-db/)
26+
27+
## License
28+
29+
The `message-db` library is released under the [MIT License](https://github.com/eventide-project/message-db/blob/master/MIT-License.txt).

install-gems.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
if [ -z ${POSTURE+x} ]; then
6+
echo "(POSTURE is not set. Using \"operational\" by default.)"
7+
posture="operational"
8+
else
9+
posture=$POSTURE
10+
fi
11+
12+
echo
13+
echo "Installing gems locally (posture: $posture)"
14+
echo '= = ='
15+
16+
cmd="bundle install --standalone --path=./gems"
17+
18+
if [ operational == "$posture" ]; then
19+
cmd="$cmd --without=development"
20+
fi
21+
22+
echo $cmd
23+
($cmd)
24+
25+
echo '- - -'
26+
echo '(done)'
27+
echo

message-db.gemspec

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- encoding: utf-8 -*-
2+
Gem::Specification.new do |s|
3+
s.name = 'message-db'
4+
s.version = '0.0.0'
5+
s.summary = 'Microservice native event store and message store for Postgres'
6+
s.description = ' '
7+
8+
s.authors = ['The Eventide Project']
9+
s.email = '[email protected]'
10+
s.homepage = 'https://github.com/message-db/message-db'
11+
s.licenses = ['MIT']
12+
13+
s.files = Dir.glob('{database}/**/*')
14+
s.executables = Dir.glob('scripts/evt-*').map(&File.method(:basename))
15+
s.bindir = 'scripts'
16+
end

scripts/mdb-clear-messages

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'clear-messages.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-create-db

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'install.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-delete-db

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'uninstall.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-install-functions

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'install-functions.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-install-indexes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'install-indexes.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-install-privileges

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'install-privileges.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-install-views

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'install-views.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-open-database-scripts-dir

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
5+
system `open #{root}`
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-category-type-summary.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-message-store-version.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-print-messages

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-messages.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-print-stream-summary

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-stream-summary.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-print-stream-type-summary

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-stream-type-summary.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-type-category-summary.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-print-type-stream-summary

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-type-stream-summary.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-print-type-summary

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'print-type-summary.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-recreate-db

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
5+
script_filename = 'uninstall.sh'
6+
script_filepath = File.join root, script_filename
7+
system script_filepath
8+
9+
script_filename = 'install.sh'
10+
script_filepath = File.join root, script_filename
11+
system script_filepath

scripts/mdb-update-db

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'update.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

scripts/mdb-write-test-message

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
root = File.expand_path '../database', __dir__
4+
script_filename = 'write-test-message.sh'
5+
script_filepath = File.join root, script_filename
6+
7+
system script_filepath

symlink-database-scripts.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
echo
6+
echo "Symlinking Database Scripts to ./database"
7+
echo "= = ="
8+
9+
if [ -z ${MESSAGE_DB_HOME+x} ]; then
10+
echo "MESSAGE_DB_HOME is not set"
11+
exit
12+
fi
13+
14+
default_database_source="$MESSAGE_DB_HOME/message-db/database"
15+
if [ -z ${DATABASE_SOURCE+x} ]; then
16+
echo "(DATABASE_SOURCE is not set. Default will be used.)"
17+
database_source=$default_database_source
18+
else
19+
database_source=$DATABASE_SOURCE
20+
fi
21+
echo "Database source is: $database_source"
22+
23+
echo
24+
echo "Removing database directory (./database)"
25+
rm -rf ./database
26+
27+
echo "Symlinking database scripts from $database_source"
28+
ln -s $database_source ./database
29+
30+
echo
31+
echo '- - -'
32+
echo 'done'
33+
echo

test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
test/interactive/scripts.sh

test/interactive/scripts.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
scripts/mdb-create-db
4+
5+
scripts/mdb-write-test-message
6+
7+
scripts/mdb-print-category-type-summary
8+
scripts/mdb-print-messages
9+
scripts/mdb-print-stream-summary
10+
scripts/mdb-print-stream-type-summary
11+
scripts/mdb-print-type-category-summary
12+
scripts/mdb-print-type-stream-summary
13+
scripts/mdb-print-type-summary
14+
scripts/mdb-print-message-store-version
15+
16+
scripts/mdb-clear-messages
17+
18+
scripts/mdb-delete-db
19+
scripts/mdb-recreate-db
20+
21+
scripts/mdb-install-functions
22+
scripts/mdb-install-indexes
23+
scripts/mdb-install-privileges
24+
scripts/mdb-install-views
25+
26+
scripts/mdb-open-database-scripts-dir

0 commit comments

Comments
 (0)