<commit_before>#!/bin/bash
set -Eeuo pipefail

scriptdir="$(dirname "$0")"

"$scriptdir"/ensure_db.sh
"$scriptdir"/refresh_schema.sh

dbName="$("$scriptdir"/db_name.sh)"
dbHost="$("$scriptdir"/db_host.sh)"

for file in $(find "$scriptdir"/../../test/db_postgres -name "*.csv")
do
  echo $file
  PGPASSWORD=postgres psql -U postgres -h $dbHost --dbname=$dbName -c "SET session_replication_role = replica;COPY webknossos.$(basename $file .csv) FROM STDOUT WITH CSV HEADER QUOTE ''''" < $file
done;

echo "Done preparing test db (host=$dbHost, name=$dbName)"<commit_msg>load renamed test db<commit_after>#!/bin/bash
set -Eeuo pipefail

scriptdir="$(dirname "$0")"

"$scriptdir"/ensure_db.sh
"$scriptdir"/refresh_schema.sh

dbName="$("$scriptdir"/db_name.sh)"
dbHost="$("$scriptdir"/db_host.sh)"

for file in $(find "$scriptdir"/../../test/db -name "*.csv")
do
  echo $file
  PGPASSWORD=postgres psql -U postgres -h $dbHost --dbname=$dbName -c "SET session_replication_role = replica;COPY webknossos.$(basename $file .csv) FROM STDOUT WITH CSV HEADER QUOTE ''''" < $file
done;

echo "Done preparing test db (host=$dbHost, name=$dbName)"
{'fraction_non_alphanumeric': 0.18374558303886926, 'fraction_numerical': 0.0017667844522968198, 'mean_word_length': 5.294444444444444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6792503', 'n_tokens_mistral': 439, 'n_tokens_neox': 410, 'n_words': 100}