Database Administration Tools

Command Line Tools

The Eventide message store Postgres database package installs command line tools for administering the database.

TIP

If you installed the tools via Bundler, prefix the following commands with bundle exec, for example: bundle exec evt-pg-create-db

Note: The message_store_postgres.json settings file does not configure the connection used for any database administrative tasks, including creating the message store schema or printing reports. The administrative connection is controlled by the facilities provided by Postgres itself. For more details, see: https://www.postgresql.org/docs/current/libpq-envars.html.

Database Schema Tools

Install the Message Store Database

evt-pg-create-db

Delete the Message Store Database

evt-pg-delete-db

Recreate the Message Store Database

evt-pg-recreate-db

Clear the Messages from the Message Store Database

evt-pg-clear-messages

Database Schema Update Tools

The schema update tools are useful when upgrading to a new release of the message store database.

Update the Database

evt-pg-update-db

This tool installs the functions, indexes, views, and privileges.

If any function, index, view, or privilege already exists, it will be replaced with the most recent definition. If any of these does not exist, they will be created.

Install Functions

evt-pg-install-functions

Install Indexes

evt-pg-install-indexes

Install Views

evt-pg-install-views

Install Privileges

evt-pg-install-privileges

Reporting

evt-pg-print-messages

Print Messages from a Specific Stream

STREAM_NAME=someStream evt-pg-print-messages
evt-pg-print-stream-summary

Print Stream Summary Statistics for a Stream Name

STREAM_NAME=someStream evt-pg-print-stream-summary

NOTE: The stream name is matched by substring using a SQL LIKE clause

evt-pg-print-type-summary

Print Type Summary Statistics for a Type Name

TYPE=SomeType evt-pg-print-type-summary

NOTE: The type name is matched by substring using a SQL LIKE clause

evt-pg-print-stream-type-summary

Print Stream and Type Summary Statistics for a Stream Name

STREAM_NAME=someStream evt-pg-print-stream-type-summary

NOTE: The stream name is matched by substring using a SQL LIKE clause

evt-pg-print-category-type-summary

Print Category and Type Summary Statistics for a Category

CATEGORY=someCategory evt-pg-print-category-type-summary

NOTE: The category name is matched by substring using a SQL LIKE clause

evt-pg-print-type-stream-summary

Print Type and Stream Summary Statistics for a Type Name

TYPE=SomeType evt-pg-print-type-stream-summary

NOTE: The type is matched by substring using a SQL LIKE clause

evt-pg-print-type-category-summary

Print Type and Category Summary Statistics for a Type Name

TYPE=SomeType evt-pg-print-type-category-summary

NOTE: The type is matched by substring using a SQL LIKE clause

Other Tools

Write a Test Message

evt-pg-write-test-message

The number of messages and the stream name can be specified using environment variables.

Write a test messages to a stream named someStream-111

STREAM_NAME=someStream-111 evt-pg-write-test-message

Write 10 test messages

INSTANCES=10 evt-pg-write-test-message

Write 10 test messages to a stream named someStream-111

STREAM_NAME=someStream-111 INSTANCES=10 evt-pg-write-test-message

Open/View the Directory Containing the Database Definition Script Files

evt-pg-open-database-scripts-dir

Use an Alternate Database Name

The database administration tools presume a database named message_store.

If you prefer a different database name, you can specify it on the command line using environment variables:

DATABASE_NAME=some_other_database evt-pg-create-db