1 2 3 4
function sd-add set idx (math 1+(sqlite3 "$argv[1]" "SELECT MAX(idx) FROM cards")) sqlite3 "$argv[1]" "INSERT INTO cards VALUES ($idx, 256, '$argv[2]', '$argv[3]')" end