CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/sqlite-go-best-practices

SQLite best practices for Go — WAL mode, foreign_keys, busy_timeout, SetMaxOpenConns, context-aware queries, transactions, migrations

98

2.36x
Quality

99%

Does it follow best practices?

Impact

97%

2.36x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Expense Tracker CLI

Problem/Feature Description

A freelancer wants a command-line expense tracker written in Go that uses SQLite to store financial records locally. The tool should work entirely offline.

The tool needs to support:

  • Adding an expense with an amount (in dollars, e.g. 42.50), category (food, transport, utilities, entertainment, other), description, and date
  • Adding an income entry with an amount, source description, and date
  • Listing expenses for a given month (YYYY-MM format), showing each expense and the total
  • Listing income for a given month
  • Showing a monthly summary: total income, total expenses, and net balance for a given month
  • Deleting an expense or income entry by ID

Each expense has: id, amount_cents (integer), category, description, date, created_at. Each income has: id, amount_cents (integer), source, date, created_at.

The amount should be stored as integer cents internally but accepted as decimal dollars from the user (e.g., "42.50" becomes 4250 cents).

Output Specification

Produce:

  • main.go -- CLI entry point with subcommands
  • db.go -- Database setup and migrations
  • expenses.go -- Expense CRUD operations
  • income.go -- Income CRUD operations
  • go.mod -- Module file

The code should be complete Go with no placeholders or TODO comments.

evals

tile.json