summaryrefslogtreecommitdiff
path: root/insert_book.sh
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2023-01-02 21:36:54 -0600
committerMark Powers <mark@marks.kitchen>2023-01-02 21:36:54 -0600
commitd0969bd6886a81dc59c5c02b12468a97b3c4cf58 (patch)
treeef44a9d1a0cf29e582f5eff90f5f6a33092fd58f /insert_book.sh
Initial commit
Diffstat (limited to 'insert_book.sh')
-rwxr-xr-xinsert_book.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/insert_book.sh b/insert_book.sh
new file mode 100755
index 0000000..cd7c782
--- /dev/null
+++ b/insert_book.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+[[ -z $1 ]] && echo "Usage: ./insert_book <title>" && exit 1
+
+docker-compose exec db psql -U tracking -d tracking -c \
+ "INSERT INTO book (title, completed) VALUES ('$1', FALSE)"