third_party: add libpg_query and sqlc

This adds sqlc, a SQL query code generator for Go (and other languages).
It in turn requires pganalyze's libpg_query, which is a C library for
parsing PostgreSQL queries.

To test:

   $ bazel build @com_github_kyleconroy_sqlc//cmd/sqlc

In the future this will be used by Bazel rules to generate sources at
build time.

Change-Id: I369c9ab503e8ce6952fd3f73c233dd3d59922358
Reviewed-on: https://review.monogon.dev/c/monogon/+/882
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/third_party/libpg_query/external.bzl b/third_party/libpg_query/external.bzl
new file mode 100644
index 0000000..de779ca
--- /dev/null
+++ b/third_party/libpg_query/external.bzl
@@ -0,0 +1,13 @@
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+
+def libpg_query_external(name, version):
+    sums = {
+        "13-2.1.2": "101a7851ee065d824fe06e300b78355a79bd5411864de707761282a0c57a0a97",
+    }
+    http_archive(
+        name = name,
+        build_file = "//third_party/libpg_query/external:BUILD.repo",
+        sha256 = sums[version],
+        strip_prefix = "libpg_query-" + version,
+        urls = ["https://github.com/pganalyze/libpg_query/archive/refs/tags/%s.tar.gz" % version],
+    )