From 5e536ef9c3a753341b63d0b7f0cad1e915197ffd Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Tue, 17 Sep 2024 16:49:52 -0400 Subject: [PATCH] Updated post --- content/blog/simple-kv-store-sqlite.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content/blog/simple-kv-store-sqlite.md b/content/blog/simple-kv-store-sqlite.md index 8d4acf3..4c3dfcb 100644 --- a/content/blog/simple-kv-store-sqlite.md +++ b/content/blog/simple-kv-store-sqlite.md @@ -16,11 +16,11 @@ For our key-value store, we're going to use a table with two columns: - A key, which we'll call `name`. This will be a unique `TEXT` type that has to be set. - The value, which we'll call `value` (Creative, I know.) For our purposes, this will also be a `TEXT` type. -The SQL to create this table is +The SQL to create this table is[^2] ```sql CREATE TABLE config( - name TEXT NOT NULL UNIQUE, + name TEXT PRIMARY KEY, value TEXT ); ``` @@ -123,4 +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`.