<commit_before>package mysql

import (
	"database/sql"
	"fmt"
	"time"

	_ "github.com/go-sql-driver/mysql"
	"h12.me/gspec/db/docker"
)

type Session struct {
	ConnStr string
	*sql.DB
	c *docker.Container
}

func New() (*Session, error) {
	container, err := docker.New("--detach=true", "--publish-all=true", "h12w/mysql:latest")
	if err != nil {
		return nil, err
	}
	time.Sleep(time.Second)
	password := ""
	connStr := fmt.Sprintf("root:%s@tcp(%s)/", password, container.Addr.String())
	x, err := sql.Open("mysql", connStr)
	if err != nil {
		container.Close()
		return nil, err
	}
	return &Session{
		ConnStr: connStr,
		DB:      x,
		c:       container,<commit_msg>mariadb is about 1 second faster.<commit_after>package mysql

import (
	"database/sql"
	"fmt"
	"time"

	_ "github.com/go-sql-driver/mysql"
	"h12.me/gspec/db/docker"
)

type Session struct {
	ConnStr string
	*sql.DB
	c *docker.Container
}

func New() (*Session, error) {
	container, err := docker.New("--detach=true", "--publish-all=true", "h12w/mariadb:latest")
	if err != nil {
		return nil, err
	}
	time.Sleep(time.Second)
	password := ""
	connStr := fmt.Sprintf("root:%s@tcp(%s)/", password, container.Addr.String())
	x, err := sql.Open("mysql", connStr)
	if err != nil {
		container.Close()
		return nil, err
	}
	return &Session{
		ConnStr: connStr,
		DB:      x,
		c:       container,
{'fraction_non_alphanumeric': 0.1762536873156342, 'fraction_numerical': 0.00663716814159292, 'mean_word_length': 3.6, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3662116', 'n_tokens_mistral': 549, 'n_tokens_neox': 521, 'n_words': 116}