Sha256: 9688e4022500b959a3b9ad7d57f0cd801c3e849c62617f66bbdf7c6b3ab20fe8

Contents?: true

Size: 831 Bytes

Versions: 31

Compression:

Stored size: 831 Bytes

Contents

#!/usr/bin/env bash

set -e

echo
echo "Printing Messages"
echo "= = ="
echo

default_name=message_store

if [ -z ${DATABASE_USER+x} ]; then
  echo "(DATABASE_USER is not set)"
  user=$default_name
else
  user=$DATABASE_USER
fi
echo "Database user is: $user"

if [ -z ${DATABASE_NAME+x} ]; then
  echo "(DATABASE_NAME is not set)"
  database=$default_name
else
  database=$DATABASE_NAME
fi
echo "Database name is: $database"

default_table_name=messages

if [ -z ${STREAM_NAME+x} ]; then
  echo "(STREAM_NAME is not set)"
  stream_name=''
else
  stream_name=$STREAM_NAME
  echo "Stream name is: $STREAM_NAME"
fi

echo

if [ -z $stream_name ]; then
  psql $database -U $user -x -P pager=off -c "SELECT * FROM messages"
else
  psql $database -U $user -x -P pager=off -c "SELECT * FROM messages WHERE stream_name = '$stream_name'"
fi

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
message-db-2.1.4 database/print-messages.sh
message-db-2.1.3 database/print-messages.sh
message-db-2.1.2 database/print-messages.sh
message-db-2.1.1 database/print-messages.sh
message-db-2.1.0 database/print-messages.sh
message-db-2.0.2 database/print-messages.sh
message-db-2.0.1 database/print-messages.sh
message-db-2.0.0 database/print-messages.sh
message-db-1.1.3 database/print-messages.sh
message-db-1.1.2 database/print-messages.sh
message-db-1.1.1 database/print-messages.sh
message-db-1.1.0 database/print-messages.sh
message-db-1.0.0 database/print-messages.sh
evt-message_store-postgres-database-1.1.0.2 database/print-messages.sh
evt-message_store-postgres-database-1.1.0.1 database/print-messages.sh
evt-message_store-postgres-database-1.1.0.0 database/print-messages.sh
evt-message_store-postgres-database-1.0.0.0 database/print-messages.sh
evt-message_store-postgres-database-0.11.0.0 database/print-messages.sh
evt-message_store-postgres-database-0.10.1.3 database/print-messages.sh
evt-message_store-postgres-database-0.10.1.2 database/print-messages.sh