SQLite best practices for Go — WAL mode, foreign_keys, busy_timeout, SetMaxOpenConns, context-aware queries, transactions, migrations
98
99%
Does it follow best practices?
Impact
97%
2.36xAverage score across 5 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent proactively applies SQLite best practices when building a financial tracking tool. Key areas: money stored as integer cents (not float), WAL mode, connection settings, context-aware queries. The task explicitly says amounts are in cents but the agent must still apply all SQLite connection best practices without being told.",
"type": "weighted_checklist",
"checklist": [
{
"name": "modernc.org/sqlite driver",
"description": "Uses modernc.org/sqlite (pure Go) rather than mattn/go-sqlite3",
"max_score": 7
},
{
"name": "WAL mode enabled",
"description": "WAL journal mode is set via connection string pragma or PRAGMA statement",
"max_score": 10
},
{
"name": "foreign_keys enabled via DSN",
"description": "Foreign key enforcement is enabled via connection string pragma",
"max_score": 8
},
{
"name": "busy_timeout set",
"description": "busy_timeout pragma is configured",
"max_score": 7
},
{
"name": "SetMaxOpenConns(1)",
"description": "db.SetMaxOpenConns(1) is called to serialize SQLite access",
"max_score": 12
},
{
"name": "Money stored as integer cents",
"description": "Monetary amounts are stored as INTEGER cents in the database (amount_cents INTEGER), not as REAL or floating-point",
"max_score": 10
},
{
"name": "Context-aware queries",
"description": "Uses QueryContext, ExecContext, QueryRowContext, BeginTx with context.Context parameters",
"max_score": 10
},
{
"name": "defer rows.Close()",
"description": "Every QueryContext call is followed by defer rows.Close()",
"max_score": 7
},
{
"name": "rows.Err() checked",
"description": "rows.Err() is checked after iterating over query results",
"max_score": 5
},
{
"name": "Parameterized queries",
"description": "All queries use ? placeholders -- no string interpolation",
"max_score": 10
},
{
"name": "CHECK constraint on category",
"description": "The expenses table includes a CHECK constraint limiting category to the valid set (food, transport, utilities, entertainment, other)",
"max_score": 5
},
{
"name": "Migration pattern",
"description": "Schema setup uses a migration pattern with version tracking, not bare CREATE TABLE calls",
"max_score": 5
},
{
"name": "Dates stored as TEXT",
"description": "Date columns use TEXT type with ISO 8601 format, leveraging SQLite's date functions",
"max_score": 4
}
]
}evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
skills
sqlite-go-best-practices
verifiers