<commit_before>package common

import (
	"database/sql"
	"encoding/base64"
	"errors"
	_ "github.com/mattn/go-sqlite3"
	"os"
	"path"
	"strings"
	"time"
)

type StoreSqlite struct {
	db *sql.DB
}

type SqliteStoreOptions struct {
	DBPath string
}

var (
	defaultOptions = SqliteStoreOptions{
		DBPath: path.Join(os.Getenv("HOME"), ".talkie", "talkie.db"),
	}

	createUsersTableStmt = `CREATE TABLE IF NOT EXISTS users (
		id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
		"key" TEXT NOT NULL,
		"name" TEXT NOT NULL,
		"email" TEXT NOT NULL,
		"created_at" TEXT
		); CREATE UNIQUE INDEX IF NOT EXISTS users_idx1 ON users(email, key);`
	createMessagesTableStmt = `CREATE TABLE IF NOT EXISTS messages (
		id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
		"from" TEXT NOT NULL,
		"to" TEXT NOT NULL,
		"duration" INTEGER,
		"content" TEXT,
		"created_at" TEXT,
		"played" INTEGER
		);`

	insertUserStmt         = `INSERT OR REPLACE INTO users (name, email, key) VALUES (?, ?, ?)`
	updateUserStmt         = `INSERT OR REPLACE INTO users (name, email, key) VALUES (?, ?, ?)`
	selectUserStmt         = `SELECT id, name, email, key FROM users WHERE id = ?`
	selectUserByKeyStmt    = `SELECT id, name, email, key FROM users WHERE key = ?`
	selectUserMessagesStmt = `SELECT id, "from", "to", "duration", "content", "created_at", "played" FROM messages WHERE "to" = ?`
	selectUserByNameStmt   = `SELECT id, name, email, key FROM users WHERE name = ?`
	deleteUserStmt         = `DELETE users WHERE id = ?`
	deleteUserByKeyStmt    = `DELETE users WHERE key = ?`
<commit_msg>Remove content when getting user messages<commit_after>package common

import (
	"database/sql"
	"encoding/base64"
	"errors"
	_ "github.com/mattn/go-sqlite3"
	"os"
	"path"
	"strings"
	"time"
)

type StoreSqlite struct {
	db *sql.DB
}

type SqliteStoreOptions struct {
	DBPath string
}

var (
	defaultOptions = SqliteStoreOptions{
		DBPath: path.Join(os.Getenv("HOME"), ".talkie", "talkie.db"),
	}

	createUsersTableStmt = `CREATE TABLE IF NOT EXISTS users (
		id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
		"key" TEXT NOT NULL,
		"name" TEXT NOT NULL,
		"email" TEXT NOT NULL,
		"created_at" TEXT
		); CREATE UNIQUE INDEX IF NOT EXISTS users_idx1 ON users(email, key);`
	createMessagesTableStmt = `CREATE TABLE IF NOT EXISTS messages (
		id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 
		"from" TEXT NOT NULL,
		"to" TEXT NOT NULL,
		"duration" INTEGER,
		"content" TEXT,
		"created_at" TEXT,
		"played" INTEGER
		);`

	insertUserStmt         = `INSERT OR REPLACE INTO users (name, email, key) VALUES (?, ?, ?)`
	updateUserStmt         = `INSERT OR REPLACE INTO users (name, email, key) VALUES (?, ?, ?)`
	selectUserStmt         = `SELECT id, name, email, key FROM users WHERE id = ?`
	selectUserByKeyStmt    = `SELECT id, name, email, key FROM users WHERE key = ?`
	selectUserMessagesStmt = `SELECT id, "from", "to", "duration", "created_at", "played" FROM messages WHERE "to" = ?`
	selectUserByNameStmt   = `SELECT id, name, email, key FROM users WHERE name = ?`
	deleteUserStmt         = `DELETE users WHERE id = ?`
	deleteUserByKeyStmt    = `DELETE users WHERE key = ?`

{'fraction_non_alphanumeric': 0.1189034109021358, 'fraction_numerical': 0.002550207204335352, 'mean_word_length': 3.835130970724191, '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': '4793108', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1082, 'n_words': 342}