From 322b79027e2d722ff126a462280e965a70eac589 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Fri, 3 Jan 2025 18:43:06 -0500 Subject: [PATCH] Update --- content/blog/simple-kv-store-sqlite.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/blog/simple-kv-store-sqlite.md b/content/blog/simple-kv-store-sqlite.md index 4c3dfcb..629792a 100644 --- a/content/blog/simple-kv-store-sqlite.md +++ b/content/blog/simple-kv-store-sqlite.md @@ -20,7 +20,7 @@ The SQL to create this table is[^2] ```sql CREATE TABLE config( - name TEXT PRIMARY KEY, + name TEXT NOT NULL, value TEXT ); ``` @@ -123,5 +123,5 @@ $ ./sqlite3_getkv.sh test.db a ``` [^1]: Somehow my idea of easier, simpler, and more maintainable is writing bash scripts. -[^2]: Thanks Justin for helping me simplify it from `NOT NULL UNIQUE` to `PRIMARY KEY`. +[^2]: Unfortantely, we can't only use the `PRIMARY KEY` qualifier for the name field as sqlite has a [historical quirk](https://www.sqlite.org/quirks.html) which allows primary keys to be null.