<commit_before>#!/bin/bash

set -ev

mysql -e 'CREATE DATABASE IF NOT EXISTS mondrian_test DEFAULT CHARACTER SET utf8;'
mysql -e "GRANT ALL PRIVILEGES ON mondrian_test.* TO 'mondrian_test'@'localhost' IDENTIFIED BY 'mondrian_test';"

psql -c "CREATE ROLE mondrian_test PASSWORD '<PASSWORD>' LOGIN CREATEDB;"
psql -c 'CREATE DATABASE mondrian_test;'
psql -c 'GRANT ALL PRIVILEGES ON DATABASE mondrian_test TO mondrian_test;'

"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
CREATE USER mondrian_test IDENTIFIED BY mondrian_test DEFAULT TABLESPACE users;
GRANT CONNECT, RESOURCE TO mondrian_test;
exit
SQL

for adapter in mysql postgresql oracle; do
  bin/rake db:create_data MONDRIAN_DRIVER=$adapter
done<commit_msg>Add utf8 collation for MySQL test database<commit_after>#!/bin/bash

set -ev

mysql -e 'CREATE DATABASE IF NOT EXISTS mondrian_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'
mysql -e "GRANT ALL PRIVILEGES ON mondrian_test.* TO 'mondrian_test'@'localhost' IDENTIFIED BY 'mondrian_test';"

psql -c "CREATE ROLE mondrian_test PASSWORD '<PASSWORD>' LOGIN CREATEDB;"
psql -c 'CREATE DATABASE mondrian_test;'
psql -c 'GRANT ALL PRIVILEGES ON DATABASE mondrian_test TO mondrian_test;'

"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
CREATE USER mondrian_test IDENTIFIED BY mondrian_test DEFAULT TABLESPACE users;
GRANT CONNECT, RESOURCE TO mondrian_test;
exit
SQL

for adapter in mysql postgresql oracle; do
  bin/rake db:create_data MONDRIAN_DRIVER=$adapter
done
{'fraction_non_alphanumeric': 0.0788243152972612, 'fraction_numerical': 0.0026720106880427524, 'mean_word_length': 5.747747747747748, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5803247', 'n_tokens_mistral': 566, 'n_tokens_neox': 556, 'n_words': 176}