From 85dc148d6cea1fbd1c1444bec0fd2851a5ddf826 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Mon, 22 Jul 2024 11:17:30 -0500 Subject: Don't need to.manually set idx since INTEGER PRIMARY KEY basically does autoincrement https://www.sqlite.org/faq.html#q1 --- sd-add.fish | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sd-add.fish b/sd-add.fish index dd4eb62..9e0e0ba 100644 --- a/sd-add.fish +++ b/sd-add.fish @@ -1,4 +1,3 @@ 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]')" + sqlite3 "$argv[1]" "INSERT INTO cards VALUES (NULL, 256, '$argv[2]', '$argv[3]')" end -- cgit v1.2.3-70-g09d2