Sha256: 6b9a22750c256efb64028f84ea1f2e5ee2cefcae6996a5aa56d8773684f7634a

Contents?: true

Size: 934 Bytes

Versions: 22

Compression:

Stored size: 934 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 ${TABLE_NAME+x} ]; then
  echo "(TABLE_NAME is not set)"
  table=$default_table_name
else
  table=$TABLE_NAME
fi
echo "Table name is: $table"

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 -x -c "SELECT * FROM $table"
else
  psql $database -x -c "SELECT * FROM $table WHERE stream_name = '$stream_name'"
fi

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
evt-message_store-postgres-database-0.4.0.0 database/print-messages.sh
evt-message_store-postgres-database-0.3.0.0 database/print-messages.sh
evt-message_store-postgres-database-0.2.0.2 database/print-messages.sh
evt-message_store-postgres-database-0.2.0.1 database/print-messages.sh
evt-message_store-postgres-database-0.2.0.0 database/print-messages.sh
evt-message_store-postgres-database-0.1.4.3 database/print-messages.sh
evt-message_store-postgres-database-0.1.4.2 database/print-messages.sh
evt-message_store-postgres-database-0.1.4.1 database/print-messages.sh
evt-message_store-postgres-database-0.1.4.0 database/print-messages.sh
evt-message_store-postgres-database-0.1.3.1 database/print-messages.sh
evt-message_store-postgres-database-0.1.3.0 database/print-messages.sh
evt-message_store-postgres-database-0.1.2.1 database/print-messages.sh
evt-message_store-postgres-database-0.1.2.0 database/print-messages.sh
evt-message_store-postgres-database-0.1.1.1 database/print-messages.sh
evt-message_store-postgres-database-0.1.1.0 database/print-messages.sh
evt-message_store-postgres-database-0.1.0.1 database/print-messages.sh
evt-message_store-postgres-database-0.1.0.0 database/print-messages.sh
evt-message_store-postgres-0.9.0.0 database/print-messages.sh
evt-message_store-postgres-0.8.0.0 database/print-messages.sh
evt-message_store-postgres-0.7.0.2 database/print-messages.sh