aboutsummaryrefslogtreecommitdiffstats
path: root/code-review-database
AgeCommit message (Collapse)Author
2019-06-10code-review-database(create_merge_base): Upsert merge baseTeddy Wing
Don't duplicate rows if we call `create_merge_base` multiple times. Doing so would mean we'd get multiple merge base rows for the same head. Instead, overwrite the existing merge base for a given head using an upsert. Thanks a bunch to MarqueIV (https://stackoverflow.com/users/168179/marqueiv) on Stack Overflow for demonstrating a way to do an upsert without the UPSERT syntax. This enables us to do an upsert on SQLite < 3.24.0. Neat trick. https://stackoverflow.com/questions/15277373/sqlite-upsert-update-or-insert/38463024#38463024
2019-06-09Move database functions from code-review-start to code-review-databaseTeddy Wing
Put these functions in a function-only file that can be sourced by other scripts that need database access.