about summary refs log tree commit diff stats
path: root/clinte.json
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-05-28 02:58:57 -0400
committerBen Morrison <ben@gbmor.dev>2020-05-28 02:58:57 -0400
commitbb327d381e5626d96942a805e6a5f4d4a5a771d5 (patch)
treec7e86c2a6ea8dc67be2221e8517806f365aac088 /clinte.json
parente4af0011c04e2861e4f890bcb7383f9c87e35126 (diff)
downloadclinte-bb327d381e5626d96942a805e6a5f4d4a5a771d5.tar.gz
extensive rewrite to use json for storage:
sqlite3 requires the directory where the database resides to be
writeable by the user. This presents a problem on multiuser UNIX systems
where they may want to limit areas where users have write access.

This rewrite totally scraps the sqlite3 database in favor of a pretty
simple json file consisting of an array of posts. flock(2) locking is
used to synchronize access to the file and make sure two clients aren't
trying to write to it at once. The locking is fairly granular right now,
but later I may change it to using a single lock for the duration of
execution since race conditions are *possible*, if unlikely for the
purposes of clinte's intended use.
Diffstat (limited to 'clinte.json')
-rw-r--r--clinte.json9
1 files changed, 9 insertions, 0 deletions
diff --git a/clinte.json b/clinte.json
new file mode 100644
index 0000000..6f1c157
--- /dev/null
+++ b/clinte.json
@@ -0,0 +1,9 @@
+{
+    "posts": [
+        {
+            "title": "Welcome to CLI NoTEs!",
+            "author": "clinte!",
+            "body": "Welcome to clinte! For usage, run 'clinte -h'"
+        }
+    ]
+}
\ No newline at end of file