Skip to content

Commit a8075fa

Browse files
committed
feat: add docs for sqlite package
1 parent 19eb4ca commit a8075fa

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,28 @@ A parser and regexes for Nix Store Paths.
5353

5454
A Nix Store path reference scanner.
5555

56+
## `pkg/sqlite`
57+
58+
A collection of interfaces and utilities for writing to and querying various `sqlite` databases that Nix uses.
59+
60+
[sqlc]: https://github.com/sqlc-dev/sqlc
61+
62+
## `pkg/sqlite/binary_cache_v6`
63+
64+
[SQLC] generated code for querying the Nar Info Disk Cache, typically located at `$XDG_CACHE_HOME/nix/binary-cache-v6.sqlite`.
65+
66+
## `pkg/sqlite/eval_cache_v5`
67+
68+
[SQLC] generated code for querying an instance of the Eval Cache, typically located at `$XDG_CACHE_HOME/nix/eval-cache-v5/*.sqlite`.
69+
70+
## `pkg/sqlite/fetcher_cache_v2`
71+
72+
[SQLC] generated code for querying the fetcher cache, typically located in `$XDG_CACHE_HOME/nix/fetcher-cache-v2.sqlite`.
73+
74+
## `pkg/sqlite/nix_v10`
75+
76+
[SQLC] generated code for querying the main Nix database, typically located in `/nix/var/nix/db.sqlite`.
77+
5678
## `pkg/wire`
5779

5880
Methods to parse and produce fields used in the low-level Nix wire protocol.

pkg/sqlite/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Sqlite Packages
2+
3+
Each subpackage targets a specific version of an internal Nix [sqlite] database.
4+
5+
The user should only edit `schema.sql` and `query.sql`. All other files are generated by [sqlc] via `sqlc generate` from
6+
the root of the repository.
7+
8+
> Note: when adding a new package, you must edit the `sqlc.yml` file at the root of the repository.
9+
10+
[sqlite]: https://www.sqlite.org/
11+
[sqlc]: https://github.com/sqlc-dev/sqlc

0 commit comments

Comments
 (0)