Open interactive SQLite shell to query and inspect the database
Open an interactive SQLite shell to query and inspect the database directly.
make sqlite-shell
This opens the SQLite CLI connected to ./data/budget.db
.tables
.schema users
.schema transactions
.schema budgets
SELECT * FROM users LIMIT 10;
SELECT COUNT(*) FROM transactions;
SELECT * FROM budgets WHERE status = 'active';
Exit the shell and run:
make sqlite-stats
Shows:
.help - Show all available commands.exit or .quit - Exit the shell.mode - Change output format (column, csv, json, etc.).headers on - Show column headers.schema - Show all table schemas.dump [table] - Export table as SQL.read file.sql - Execute SQL from file/db-backup before any modifications-- Connect to database
sqlite> .tables
-- View users
sqlite> SELECT id, email, role FROM users;
-- Count transactions by type
sqlite> SELECT type, COUNT(*) FROM transactions GROUP BY type;
-- Check budget status
sqlite> SELECT name, amount, spent FROM budgets ORDER BY created_at DESC LIMIT 5;
-- Exit
sqlite> .exit
/db-backup - Create database backupmake sqlite-stats - View database statisticsmake migrate-create - Create new migration