<commit_before>#!/bin/bash


DUMP_LOCATION=${DUMP_LOCATION:-/tmp/dump.sql}

PGHOST=$SOURCE_PG_HOST PGUSER=$SOURCE_PG_USER PGPORT=$SOURCE_PG_PORT pg_dump $SOURCE_PG_DBNAME > $DUMP_LOCATION

PGHOST=$TARGET_PG_HOST PGUSER=$TARGET_PG_USER PGPORT=$TARGET_PG_PORT psql $TARGET_PG_DBNAME < $DUMP_LOCATION
<commit_msg>Add logging<commit_after>#!/bin/bash


DUMP_LOCATION=${DUMP_LOCATION:-/tmp/dump.sql}

echo "Dumping from ${SOURCE_PG_DBNAME}@${SOURCE_PG_HOST}..."
PGHOST=$SOURCE_PG_HOST PGUSER=$SOURCE_PG_USER PGPORT=$SOURCE_PG_PORT pg_dump $SOURCE_PG_DBNAME > $DUMP_LOCATION

echo $(ls -la $DUMP_LOCATION)

echo "Importing to ${TARGET_PG_DBNAME}@${TARGET_PG_HOST}..."
PGHOST=$TARGET_PG_HOST PGUSER=$TARGET_PG_USER PGPORT=$TARGET_PG_PORT psql $TARGET_PG_DBNAME < $DUMP_LOCATION

{'fraction_non_alphanumeric': 0.125810635538262, 'fraction_numerical': 0.0, 'mean_word_length': 9.432432432432432, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5234890', 'n_tokens_mistral': 309, 'n_tokens_neox': 305, 'n_words': 41}