summary refs log tree commit diff
path: root/unscoop.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-05 11:22:42 -0500
committerJune McEnroe <june@causal.agency>2019-12-05 11:22:42 -0500
commitad68bbd4122683ac1ac00ebfeea6cdcfaae40777 (patch)
tree00f7813565483533315fff63811469140bdd3c72 /unscoop.c
parentInsert colons into timezones (diff)
downloadlitterbox-ad68bbd4122683ac1ac00ebfeea6cdcfaae40777.tar.gz
litterbox-ad68bbd4122683ac1ac00ebfeea6cdcfaae40777.zip
Import in one transaction per file
Diffstat (limited to '')
-rw-r--r--unscoop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/unscoop.c b/unscoop.c
index be57128..73beeb1 100644
--- a/unscoop.c
+++ b/unscoop.c
@@ -187,6 +187,7 @@ int main(int argc, char *argv[]) {
 		FILE *file = fopen(argv[i], "r");
 		if (!file) err(EX_NOINPUT, "%s", argv[i]);
 
+		dbBegin(db);
 		ssize_t len;
 		while (0 < (len = getline(&line, &cap, file))) {
 			for (size_t i = 0; i < format->len; ++i) {
@@ -241,6 +242,7 @@ int main(int argc, char *argv[]) {
 		}
 		if (ferror(file)) err(EX_IOERR, "%s", argv[i]);
 		fclose(file);
+		dbCommit(db);
 	}
 	printf("\n");
 
an title='2020-02-05 21:23:00 -0500'>2020-02-05Some more cleanupdestruc7i0n 2020-02-05More config handlingdestruc7i0n 2020-02-04Update typesdestruc7i0n 2020-02-04Docs updatesdestruc7i0n 2020-02-04Code cleanupdestruc7i0n 2020-02-04Refactor and rebuild to TypeScriptdestruc7i0n 2019-02-11Local file supportdestruc7i0n 2018-11-11Let's make this usable again!destruc7i0n 2018-02-23Allow configurable discord formatArcensoth 2018-02-23Revert example tellraw format to mimic the originalArcensoth 2018-02-23Update readme with new tellraw config optionArcensoth 2018-02-23Allow configurable tellraw formatArcensoth 2018-02-23Allow config file to be passed as a parameterArcensoth