From 59c65c900c3622c9e5d2dea098f231d81f39c112 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Tue, 1 Oct 2024 12:21:31 +0100 Subject: [PATCH] feat: add docs for sqlite package --- README.md | 22 ++++++++++++++++++++++ pkg/sqlite/README.md | 11 +++++++++++ 2 files changed, 33 insertions(+) create mode 100644 pkg/sqlite/README.md diff --git a/README.md b/README.md index dac86c0..4d84641 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,28 @@ A parser and regexes for Nix Store Paths. A Nix Store path reference scanner. +## `pkg/sqlite` + +A collection of interfaces and utilities for writing to and querying various `sqlite` databases that Nix uses. + +[sqlc]: https://github.com/sqlc-dev/sqlc + +## `pkg/sqlite/binary_cache_v6` + +[SQLC] generated code for querying the Nar Info Disk Cache, typically located at `$XDG_CACHE_HOME/nix/binary-cache-v6.sqlite`. + +## `pkg/sqlite/eval_cache_v5` + +[SQLC] generated code for querying an instance of the Eval Cache, typically located at `$XDG_CACHE_HOME/nix/eval-cache-v5/*.sqlite`. + +## `pkg/sqlite/fetcher_cache_v2` + +[SQLC] generated code for querying the fetcher cache, typically located in `$XDG_CACHE_HOME/nix/fetcher-cache-v2.sqlite`. + +## `pkg/sqlite/nix_v10` + +[SQLC] generated code for querying the main Nix database, typically located in `/nix/var/nix/db.sqlite`. + ## `pkg/wire` Methods to parse and produce fields used in the low-level Nix wire protocol. diff --git a/pkg/sqlite/README.md b/pkg/sqlite/README.md new file mode 100644 index 0000000..f8a5fff --- /dev/null +++ b/pkg/sqlite/README.md @@ -0,0 +1,11 @@ +# Sqlite Packages + +Each subpackage targets a specific version of an internal Nix [sqlite] database. + +The user should only edit `schema.sql` and `query.sql`. All other files are generated by [sqlc] via `sqlc generate` from +the root of the repository. + +> Note: when adding a new package, you must edit the `sqlc.yml` file at the root of the repository. + +[sqlite]: https://www.sqlite.org/ +[sqlc]: https://github.com/sqlc-dev/sqlc