<commit_before>#!/usr/bin/env bash

haxby::core::modes::register newdb
haxby::modes::help::register "newdb: Create new database schema folder"

function haxby::modes::newdb {
    db=$1
    if [[ -z "$db" ]]
    then
        echo "Usage: haxby newdb name"
        exit 1
    fi

    mkdir -p $HAXBY_DATABASE_D/$1/{schemas.d,data.d}
    pushd $HAXBY_DATABASE_D/$1 >/dev/null
    touch init.sql

    (
        cat <<EOF
        \connect postgres

        DROP DATABASE IF EXISTS $1;
        CREATE DATABASE $1;

        \connect $1

        -- Add any DB initialization code here
        -- i.e. Create users/roles
        EOF
    ) >init.sql

    popd >/dev/null
}<commit_msg>Correct issue in here document for new-db<commit_after>#!/usr/bin/env bash

haxby::core::modes::register newdb
haxby::modes::help::register "newdb: Create new database schema folder"

function haxby::modes::newdb {
    db=$1
    if [[ -z "$db" ]]
    then
        echo "Usage: haxby newdb name"
        exit 1
    fi

    mkdir -p $HAXBY_DATABASE_D/$1/{schemas.d,data.d}
    pushd $HAXBY_DATABASE_D/$1 >/dev/null
    touch init.sql

    (
        cat <<EOF
\connect postgres

DROP DATABASE IF EXISTS $1;
CREATE DATABASE $1;

\connect $1

-- Add any DB initialization code here
-- i.e. Create users/roles
EOF
    ) >init.sql

    popd >/dev/null
}
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.010606060606060607, 'mean_word_length': 2.3527918781725887, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '865234', 'n_tokens_mistral': 514, 'n_tokens_neox': 477, 'n_words': 128}