summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-30 22:27:46 -0500
committerJune McEnroe <june@causal.agency>2019-12-30 22:29:08 -0500
commitde6980860b012fd2dfd1f7a77b47473ff290dc4f (patch)
treebbd46f89d2ccd120c28c7f941e6c9a97a8fe8c01
parentAdd -D flag to prospective scoop manual (diff)
downloadlitterbox-de6980860b012fd2dfd1f7a77b47473ff290dc4f.tar.gz
litterbox-de6980860b012fd2dfd1f7a77b47473ff290dc4f.zip
Join with USING wherever possible
Diffstat (limited to '')
-rw-r--r--database.h2
-rw-r--r--litterbox.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/database.h b/database.h
index 1837a9f..d02bc28 100644
--- a/database.h
+++ b/database.h
@@ -266,7 +266,7 @@ static const char *InitSQL = SQL(
 		nick, user, target, message
 	FROM events
 	JOIN contexts USING (context)
-	JOIN names ON names.name = events.name;
+	JOIN names USING (name);
 
 	CREATE VIRTUAL TABLE search USING fts5 (
 		network, channel, query, nick, user, target, message,
diff --git a/litterbox.c b/litterbox.c
index af531ff..2ab2bf1 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -219,8 +219,8 @@ static void querySearch(struct Message *msg) {
 				highlight(search, 6, :bold, :bold),
 				events.event
 			FROM events
-			JOIN contexts ON contexts.context = events.context
-			JOIN names ON names.name = events.name
+			JOIN contexts USING (context)
+			JOIN names USING (name)
 			JOIN search ON search.rowid = events.event
 			WHERE contexts.network = :network
 				AND coalesce(contexts.query = :query, true)
2ccd0b14876b22697cfa8981&follow=1'>Add missing includeJune McEnroe 2019-12-31Use standout mode for highlightingJune McEnroe 2019-12-31Rewrite scoop(1) argument descriptionsJune McEnroe 2019-12-31Color both nicks in a changeJune McEnroe 2019-12-31Implement nick-colored outputJune McEnroe 2019-12-31Only enable highlighting on terminal outputJune McEnroe 2019-12-31Set up pager pipeJune McEnroe 2019-12-30Normalize date inputJune McEnroe 2019-12-30Add initial rough version of scoopJune McEnroe 2019-12-30Join with USING wherever possibleJune McEnroe 2019-12-30Add -D flag to prospective scoop manualJune McEnroe 2019-12-30Order results by ID in outer query in litterboxJune McEnroe 2019-12-30Use X macro for Type enumJune McEnroe 2019-12-30Remove scoop -ABCJune McEnroe 2019-12-30Add limit option for litterbox's search query interfaceJune McEnroe